/ Published in: ActionScript 3
Create a 100 frame MovieClip animation in companion with this code to create a preloader. Place the rest of your Flash application on the following Scene or Frame
Expand |
Embed | Plain Text
/*************************** Event Handler ***************************/ addEventListener(Event.ENTER_FRAME, loading); /*************************** Function ***************************/ function loading(e:Event) { var bytestotal = stage.loaderInfo.bytesTotal; var bytesloaded = stage.loaderInfo.bytesLoaded; var percent = Math.round(bytesloaded * 100/bytestotal); mc_with_100_frame_animation.gotoAndPlay(percent); if (bytesloaded >= bytestotal) { gotoAndStop(2); removeEventListener(Event.ENTER_FRAME, loading); removeChild(custom_animation); } } stop();
Comments
Subscribe to comments
You need to login to post a comment.

Is the "customanimation" referring to the "mcwith100frame_animation"?
I received this error when trying it.
1120: Access of undefined property custom_animation.
Your custom animation is a 100 Frame MovieClip with, in this case, an instance name of "mcwith100frameanmiation"
hello, I'm new at as3 and noob with flash also, i'm having this trouble..
function does not have a body (line 9 here 18 in flash)
i love the 100 frames preloaders, so this is perfect for me thx!!!!!!
thanyou