# Output Issues with AS buttons

**URL:** <https://forum.kirupa.com/t/output-issues-with-as-buttons/299080>\
**Category:** flash\
**Created:** [October 29, 2009, 1:28pm UTC](https://forum.kirupa.com/t/output-issues-with-as-buttons/299080 "2009-10-29T13:28:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferretinthebush](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@ferretinthebush](https://forum.kirupa.com/u/ferretinthebush)\
**Post date:** [October 29, 2009, 1:28pm UTC](https://forum.kirupa.com/t/output-issues-with-as-buttons/299080/1 "2009-10-29T13:28:37Z")

</div>

Hi,

Don’t know much about AS but I have tried to work my way through it.  
I can’t understand why my button actions are causing an output error,  
the first two on this keyframe work just fine, but when I add the third it causes  
this error…

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

Here is the script

stop ();

function clickFunction(evt:MouseEvent):void {  
gotoAndPlay(87, “Scene 1” );  
}  
ak\_btn.addEventListener(MouseEvent.CLICK, clickFunction);

function clickGrap(evt:MouseEvent):void {  
gotoAndPlay(145, “Scene 1” );  
}  
sg\_btn.addEventListener(MouseEvent.CLICK, clickGrap);

function clickTrav(evt:MouseEvent):void {  
gotoAndPlay(153, “Scene 1” );  
}  
az.addEventListener(MouseEvent.CLICK, clickTrav);

Like I said, sg\_btn and ak\_btn work, but az causes the error…  
They are all on the same keyframe, dont know if that matters

If anybody can help me out it is appreciated.

Mike
