Hi i am a beginner in actionscript coding and i am getting the error below when i click the “new game” button :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at aircombat1_fla::MainTimeline/moveMyfighter()
Can anybody tell me what the problem could be ?
you can see the movie here : http://www.myholidays.dk/flash/finalproject/aircombat1.html
My code look like this :
stop();
scoreDisplay.text=score.toString();
timeDisplay.text=seconds.toString();
Mouse.show();
myfighter.removeEventListener (Event.ENTER_FRAME, moveMyfighter);
enemyTarget.removeEventListener (Event.ENTER_FRAME, moveEnemy);
newgame_btn.addEventListener(MouseEvent.MOUSE_DOWN, startnewgame);
var mySO:SharedObject;
mySO = SharedObject.getLocal(“myfirstSO”);
save_btn.addEventListener(MouseEvent.CLICK, saveText);
function saveText(e:MouseEvent):void
{
mySO.data.myText = savegame_txt.text;
}
if (mySO.data.myText)
{
savegame_txt.text = mySO.data.myText;
}
function startnewgame (event):void{
gotoAndPlay(“intro”);
}