ForumsProgramming ForumWhat's wrong?

0 4228
maffegozer
offline
maffegozer
64 posts
Nomad

Hello,

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{

Regards, maffegozer.
  • 0 Replies
Showing 1-0 of 0