Simple Preloader Setup for Actionscript 2


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



Copy this code and paste it in your HTML
  1. this.onEnterFrame = function() {
  2. filesize = myMovieClip.getBytesTotal();
  3. loaded = myMovieClip.getBytesLoaded();
  4. preloader._visible = true;
  5. if (loaded != filesize) {
  6. percent = 100*loaded/filesize;
  7. preloader.preload_bar._xscale = percent;
  8. } else {
  9. preloader._visible = false;
  10. onMovieClipLoaded();
  11. delete this.onEnterFrame
  12. }
  13. };
  14.  
  15. onMovieClipLoaded = function(){
  16. trace("if you are reading this, the movieclip has been loaded");
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.