I was making a (pre)loader. But can't get it to work...
Actionscript:
stop();
addEventListener(Event.ENTER_FRAME, preLoad)
function preLoad(e:Event):void{ var bytestoLoad:Number = loaderInfo.bytesTotal; var numberloaded:Number = LoaderInfo.bytesLoaded; if (bytestoLoad == numberloaded){ removeEventListener(Event.ENTER_FRAME, preLoad) gotoAndStop(2); }else { preLoader.preLoaderFill.scaleX = numberloaded/bytestoLoad; preLoader.bytesPercent.text = Math.floor(numberloaded/bytestoLoad*100) + "%"; } }
Please tell what's wrong with the script...
Errors: Description: Statement must appear within on/onClipEvent handler Source: stop(); Description: Statement must appear within on/onClipEvent handler Source: addEventListener(Event.ENTER_FRAME, preLoad) Description: The class or interface 'Event' could not be loaded. Source: function preLoad(e:Event):void{