# NEED HELP with Actionscript 3.0 codes!

**URL:** <https://forum.kirupa.com/t/need-help-with-actionscript-3-0-codes/297312>\
**Category:** flash\
**Created:** [September 30, 2009, 4:18am UTC](https://forum.kirupa.com/t/need-help-with-actionscript-3-0-codes/297312 "2009-09-30T04:18:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marjoh16](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@marjoh16](https://forum.kirupa.com/u/marjoh16)\
**Post date:** [September 30, 2009, 4:18am UTC](https://forum.kirupa.com/t/need-help-with-actionscript-3-0-codes/297312/1 "2009-09-30T04:18:14Z")

</div>

So the thing is;

I am working on a interactive instructional how-to video on school. It begins with a intro page, and then a button where it says that you can start the instruction. Then it goes on to step 1, and then you have 2 buttons from now on that can navigate you forward and backward between the steps.

I made a new layer, and made 3 different keyframes. On each keyframe is a step. I made a new layer on top of this one where I am going to put in the actionscript codes.

So the problem is:

The first button on the first frame works fine. It takes me to the next frame and step. I used the code:

stop();

start\_btn.addEventListener(MouseEvent.CLICK, nextframe1);  
function nextframe1(event:MouseEvent):void {  
gotoAndStop(5)  
}

I use the same code for the next frame, but the button on this frame will not take me any further. So this is what the codes look like:

stop();

start\_btn.addEventListener(MouseEvent.CLICK, nextframe1);  
function nextframe1(event:MouseEvent):void {  
gotoAndStop(5)  
}  
next1\_btn.addEventListener(MouseEvent.CLICK, nextframe2);  
function nextframe2(event:MouseEvent):void {  
gotoAndStop(10)  
}

I get the error message saying:

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

Can someone please help me? I am so close to throwing my mac in the wall right now.

Mari
