Posted By

nalmeida on 12/11/09


Tagged

flash loader


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

jhoard
zoo
tspitzr
mitien


AS3 Self Preloader


 / Published in: ActionScript 3
 

Add the code at the first frame.

  1. import flash.display.*;
  2. stop();
  3.  
  4. loaderInfo.addEventListener(ProgressEvent.PROGRESS, plLoading);
  5.  
  6.  
  7. function plLoading(event:ProgressEvent):void {
  8. var pcent:int=event.bytesLoaded/event.bytesTotal;
  9. trace(pcent);
  10. if (pcent>=1) {
  11. loaderInfo.removeEventListener(ProgressEvent.PROGRESS, plLoading);
  12. // LOADED!
  13. //nextScene();
  14.  
  15. }
  16. }

Report this snippet  

You need to login to post a comment.