Posted By

happytogetherannie on 11/23/11


Tagged

preloader


Versions (?)

flash preloader for AS3


 / Published in: ActionScript 3
 

can solve the IE reload problem

  1. stop();
  2.  
  3. this.addEventListener(Event.ENTER_FRAME, loading);
  4.  
  5. function loading(e:Event):void{
  6.  
  7. var total:Number = this.stage.loaderInfo.bytesTotal;
  8. var loaded:Number = this.stage.loaderInfo.bytesLoaded;
  9.  
  10. lbar.scaleX = loaded/total;
  11. loader_txt.text = Math.floor((loaded/total)*100)+ "%";
  12.  
  13. if (total == loaded){
  14. gotoAndPlay(2);
  15. this.removeEventListener(Event.ENTER_FRAME, loading);
  16. }
  17.  
  18. }

Report this snippet  

You need to login to post a comment.