Found a good piece of code that is just a straight forward, simple barebones preloader
addEventListener(Event.ENTER_FRAME, preloaderFunction); function preloaderFunction(event:Event) :void { var bytestotal = stage.loaderInfo.bytesTotal; var bytesloaded = stage.loaderInfo.bytesLoaded; var pctLoaded:int = bytesloaded * 100 / bytestotal; preloader.loadingField.text = String(pctLoaded) + "%"; if (bytesloaded >= bytestotal) { removeEventListener(Event.ENTER_FRAME, preloaderFunction); nextFrame(); } }
Source:
MikeTheVike at: http://www.actionscript.org/forums/showthread.php3?t=151850
Tech Reference: AS3
Leave a Reply