# CS5: Simple Frame Navigation Problem

**URL:** https://forum.kirupa.com/t/cs5-simple-frame-navigation-problem/314989
**Category:** flash
**Created:** [October 14, 2010, 7:02am UTC](https://forum.kirupa.com/t/cs5-simple-frame-navigation-problem/314989 "2010-10-14T07:02:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MikoCat](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@MikoCat](https://forum.kirupa.com/u/MikoCat)
#### Post date: [October 14, 2010, 7:02am UTC](https://forum.kirupa.com/t/cs5-simple-frame-navigation-problem/314989/1 "2010-10-14T07:02:14Z")

</div>

OK so I have a flash project consisting of **four** keyframes with “stop()” on the first frame so that it doesn’t play through.  
I have “next” and “back” buttons on each keyframe so that you can navigate between the frames.

However, I have a problem where the buttons seem to remember the frame they were on and they skip keyframes when navigating back and forth.

Example:

[LIST]  
[_]I’m on **keyframe 2** and press the “next button” and it takes me to **keyframe 3**.  
[_]I’m now on **keyframe 3** and I press the “back button” and it takes me back to **keyframe 2**.  
[\*]I’m back on **keyframe 2** and I press the “next button” and it takes me to **keyframe 4**???  
[/LIST]  
I have basic code on each keyframe.  
On keyframe 2 I have this code:

```auto
next_btn.addEventListener(MouseEvent.CLICK, nextone); 
function nextone(event:MouseEvent):void 
{     
nextFrame();
}  

back_btn.addEventListener(MouseEvent.CLICK, prevone); 
function prevone(event:MouseEvent):void 
{     
prevFrame();
}

```

And on keyframe 3 I have basically the same code except I changed the function variables.  
I am new to actionscript, especially AS3 and this should be very easy to accomplish but I don’t know why it’s not working

I have tried using gotoAndStop() with the frame number in the brackets and also frame labels but it all does the same thing.  
I am starting to think it’s a bug with flash CS5 because I believe I am doing everything correctly.

**I have attached a .fla file that demonstrates this problem so please take a look.**  
Thanks.
