Posted By

dessimoni on 12/03/10


Tagged

flash loader as3


Versions (?)

AS3 Self-loader


 / Published in: ActionScript
 

Colocar preferencialmente em uma cena dedicada, na frente de todas, com o mínimo possível de elementos.

  1. stop();
  2.  
  3. loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
  4. loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
  5.  
  6. function loadProgress( evt:ProgressEvent ):void {
  7. var ratio:Number = loaderInfo.bytesLoaded/loaderInfo.bytesTotal;
  8. var percent:int = int( radio*100 );
  9. trace( percent + "%" );
  10. }
  11. function loadComplete(e:Event):void {
  12. play();
  13. }

Report this snippet  

You need to login to post a comment.