# Error #1009 when I add a button to the stage

**URL:** <https://forum.kirupa.com/t/error-1009-when-i-add-a-button-to-the-stage/289873>\
**Category:** flash\
**Created:** [June 5, 2009, 10:13pm UTC](https://forum.kirupa.com/t/error-1009-when-i-add-a-button-to-the-stage/289873 "2009-06-05T22:13:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrinak](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mrinak](https://forum.kirupa.com/u/mrinak)\
**Post date:** [June 5, 2009, 10:13pm UTC](https://forum.kirupa.com/t/error-1009-when-i-add-a-button-to-the-stage/289873/1 "2009-06-05T22:13:29Z")

</div>

Hi there -  
Argh.I have a timeline project. Each “date” aka button when clicked advances to its respective named frame. It works fine until I have a section of the timeline with more than one “entry”. I use the same naming process as i did for the main sections using a “next \>” button and coding it the same way I coded the main buttons but it doesn’t work. I get:  
[COLOR=Red]  
Type Error: Error #1009. Cannot access a property or method fo a null object reference at Timeline\_Sce3\_fla::MainTimeline/frame1()[/COLOR]

[COLOR=Black]My fla is posted here : [/COLOR][http://www.iser.uaa.alaska.edu/test/Flash/Timeline\_Sce3.fla](http://www.iser.uaa.alaska.edu/test/Flash/Timeline_Sce3.fla)

I’ve dragged an instance of the bttn\_next onto the stage, given it an instance name, inserted a keyframe into the layer and named the layer to advance to. I know there’s something wrong with this button - could this be a flow or inheritance problem? i’ve commented out the line that throws the error (starts with //btn1974b…). the code reads:

stop();

b1971.addEventListener(MouseEvent.CLICK,clickSection);  
b1973.addEventListener(MouseEvent.CLICK,clickSection);  
b1974.addEventListener(MouseEvent.CLICK,clickSection);  
[//btn1974b.addEventListener](https://btn1974b.addEventListener)(MouseEvent.CLICK,clickSection);  
b1976.addEventListener(MouseEvent.CLICK,clickSection);  
b1977.addEventListener(MouseEvent.CLICK,clickSection);  
b1980.addEventListener(MouseEvent.CLICK,clickSection);  
b1982.addEventListener(MouseEvent.CLICK,clickSection);  
b1985.addEventListener(MouseEvent.CLICK,clickSection);  
b1986.addEventListener(MouseEvent.CLICK,clickSection);  
b1987.addEventListener(MouseEvent.CLICK,clickSection);  
b1989.addEventListener(MouseEvent.CLICK,clickSection);  
b1990.addEventListener(MouseEvent.CLICK,clickSection);  
b2005.addEventListener(MouseEvent.CLICK,clickSection);  
b2006.addEventListener(MouseEvent.CLICK,clickSection);  
b2008.addEventListener(MouseEvent.CLICK,clickSection);  
b2009.addEventListener(MouseEvent.CLICK,clickSection);

//handle events for buttons

function clickSection(evtObj:MouseEvent) {  
//trace action show’s what’s happening in output window  
trace(""+evtObj.target.name+“button was clicked!”);  
gotoAndStop(evtObj.target.name);

}

any help is GREATLY appreciated.

thanks
