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:
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.