![]() |
How to properly use ProgressEvent's bytesLoaded and bytesTotal for file download
Hi All,
I am using Flex 4, Actionscript 3. I am using FileReference's download method, which automatically opens the "Save As" dialog window (ie. I don't have to explicitly call browse like for an upload). I'd like the label of my ProgressBar component to display downloading <%> ... In my ProgressEvent handler, I tried Code:
prgbr_fileDownload.label = "downloading %3%%...";I then tried Code:
prgbr_fileDownload.label = "downloading " + Math.round( ( event.bytesLoaded/event.bytesTotal ) * 100 ) + "% ...";I then noticed my trace statements displaying the following: progressHandler name = g2.zip bytesLoaded = 98304 bytesTotal = 98304Hence, obviously my last computation would not work. How can I get the percentage downloaded to be displayed correctly? Thanks, Bonnie |
| All times are GMT +1. The time now is 09:10 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.