Posted By

Bonky on 09/26/07


Tagged

download loop load loader progress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dazza


Load Progress Checking


 / Published in: ActionScript
 

General-purpose load checker. Place on first frame of your movie.

  1. stop();
  2.  
  3. var checkLoadInterval:Number;
  4. var percentLoaded:Number=0;
  5. checkLoadInterval = setInterval(this, "checkLoaded", 30);
  6. function checkLoaded():Boolean {
  7. //trace("checkit");
  8. if (_level0.getBytesLoaded()>=_level0.getBytesTotal()) {
  9. percentDisplay.text="100%";
  10. gotoAndStop("active");
  11. clearInterval(checkLoadInterval);
  12. //intervalId = setInterval(this, "progress", duration);
  13. //}
  14. return true;
  15. } else {
  16. percentLoaded=Math.round((getBytesLoaded()/getBytesTotal())*100);
  17. trace(percentLoaded);
  18. percentDisplay.text=percentLoaded+ "%";
  19. return false;
  20. }
  21. }

Report this snippet  

You need to login to post a comment.