2

Iam trying to run preloader with percentage but it not show the percent in dynamic text please anyone give the solution..

import flash.events.ProgressEvent;
import flash.events.Event;
import flash.display.LoaderInfo;

loaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);

  function loading(e:ProgressEvent):void
  {
    var Percent:Number = e.bytesLoaded/e.bytesTotal*100;
    myText.text = Math.round(Percent)+"%";



if(Percent == 100)
{
    loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loading);


}
 }
Hemanth Raj
  • 187
  • 10
  • 1
    Try to replace `myText.text = Math.round(Percent)+"%";` with `trace(Math.round(Percent)+"%");`. Do you see 100% in Output panel? – Daniil Subbotin May 27 '17 at 10:52
  • 1
    (1) Answer above comment since above shown code is not enough for us to test your issue (2) Declare `var Percent:Number = 0;` outside of and before any functions. Then you update the var as `Percent = e.bytesLo... etc` (3) Make sure font is embedded for your text field – VC.One May 27 '17 at 19:40

0 Answers0