0 Replies - 1323 Views - Last Post: 13 December 2009 - 03:23 PM

#1 yibman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-December 09

TypeError: Error #1009: Cannot access a property or method of a null o

Posted 13 December 2009 - 03:23 PM

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.myholiday...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");
}

Is This A Good Question/Topic? 0
  • +

Page 1 of 1