/ Published in: ActionScript 3
add every item in the library to the frame that comes after this code.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
addEventListener(Event.ENTER_FRAME, loading); stop(); function loading(event:Event) { var bytestotal = stage.loaderInfo.bytesTotal; var bytesloaded = stage.loaderInfo.bytesLoaded; var loader = Math.round(bytesloaded*100/bytestotal); moviePreloader_mc.LoaderMask.scaleX = loader/100; moviePreloader_mc.percent2.text = int(loader)+"%"; if (bytesloaded == bytestotal) { gotoAndPlay(2); removeEventListener(Event.ENTER_FRAME, loading); } }