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

**URL:** https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/301679
**Category:** Uncategorized
**Created:** [December 13, 2009, 10:30pm UTC](https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/301679 "2009-12-13T22:30:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yibman](https://avatars.discourse-cdn.com/v4/letter/y/e9a140/32.png) [@yibman](https://forum.kirupa.com/u/yibman)
#### Post date: [December 13, 2009, 10:30pm UTC](https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/301679/1 "2009-12-13T22:30:50Z")

</div>

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](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”);  
}
