AS3 Display Formatted Percentage


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.