/***************************
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();
Custom Preloader
Category: Uncategorized |
Tags: as3
Leave a Reply
You must be logged in to post a comment.