So i’m trying to create a preloader for my game, and when it loads it it says theres an indefinite term that has no properties. The code of the preloader is:
var l:Loader= new Loader();
l.load(new URLRequest("Fisic_Steps_ing_Version.swf"));
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressivo);
l.contentLoaderInfo.addEventListener(Event.COMPLETE,completo);
function progressivo (e:ProgressEvent) :void{
bar.scaleX= e.bytesLoaded/e.bytesTotal;
}
function completo (e:Event) :void{
addChild(l);
}
And the code i have at the first frame is:
import flash.events.KeyboardEvent;
stop();
stage.addEventListener(KeyboardEvent.KEY_DOWN, startGameFs);
function startGameFs (e:KeyboardEvent) :void{
inicio_teclas.gotoAndPlay(2);
stage.removeEventListener(KeyboardEvent.KEY_DOWN,startGameFs);
}
Anyone knows why this happens?