Posted By

adrianparr on 04/14/10


Tagged

formatted progress as3 percent percentage bytestotal bytesloaded progressevent


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

socialflasher
Nikolai
tspitzr
scottwatkins


AS3 Display Formatted Percentage


 / Published in: ActionScript 3
 

  1. var total:Number = event.target.bytesTotal;
  2. var part:Number = event.target.bytesLoaded;
  3. var percentage:Number = part / total;
  4. var percentageFormatted:String = Math.floor(percentage * 100)+"%";
  5. trace("percentageFormatted: "+percentageFormatted);

Report this snippet  

You need to login to post a comment.