Posted By

Daxander on 08/02/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tspitzr


AS3: Preloader on frame 1


 / Published in: ActionScript 3
 

  1. loader3D.visible = true;
  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. loader_txt.text = Math.floor((loaded/total)*100)+ "%";
  11.  
  12. if (loaded == total){
  13. gotoAndPlay(2);
  14. this.removeEventListener(Event.ENTER_FRAME, loading);
  15. loader3D.visible = false;
  16. }
  17.  
  18. }

Report this snippet  

You need to login to post a comment.