# TypeError: Error #1009

**URL:** <https://forum.kirupa.com/t/typeerror-error-1009/257616>\
**Category:** Uncategorized\
**Created:** [April 15, 2008, 5:56pm UTC](https://forum.kirupa.com/t/typeerror-error-1009/257616 "2008-04-15T17:56:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![salia](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@salia](https://forum.kirupa.com/u/salia)\
**Post date:** [April 15, 2008, 5:56pm UTC](https://forum.kirupa.com/t/typeerror-error-1009/257616/1 "2008-04-15T17:56:27Z")

</div>

Hello. I am getting a null object reference error on a button. The button is placed in frame 1 and has small roll over and roll out animations. When the button is clicked, flash resumes play at a point further down the timeline. I can avoid the error by removing the roll out animation or by having the gotoAndPlay command point to a frame earlier than the frame when the button was clicked. How can I change the command to keep the roll out animation and still have the button function as a skip button? Thank you.

AS 3.0 Command:  
myBtn.buttonMode = true;  
myBtn.addEventListener(MouseEvent.ROLL\_OVER,animIn);  
myBtn.addEventListener(MouseEvent.ROLL\_OUT,animOut);  
function animIn(event:MouseEvent):void {  
myBtn.gotoAndPlay(5);  
}  
function animOut(event:MouseEvent):void{  
myBtn.gotoAndPlay(11);  
}  
myBtn.addEventListener(MouseEvent.MOUSE\_DOWN,skipintro);  
function skipintro(event:MouseEvent):void{  
gotoAndPlay(285);  
}

Error Displayed:  
TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at index\_fla::MainTimeline/animOut()
