/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
this.onEnterFrame = function() { filesize = myMovieClip.getBytesTotal(); loaded = myMovieClip.getBytesLoaded(); preloader._visible = true; if (loaded != filesize) { percent = 100*loaded/filesize; preloader.preload_bar._xscale = percent; } else { preloader._visible = false; onMovieClipLoaded(); delete this.onEnterFrame } }; onMovieClipLoaded = function(){ trace("if you are reading this, the movieclip has been loaded"); }