AS3 Self-loader


/ Published in: ActionScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.