Problems with Next and Back Buttons ActionScript 3.0
Bodach Nov 6, 2014 10:42 AMHi,
I have set up a Back, Play and Next buttons in a slideshow I am making. The next and back buttons work correctly until it gets to the end.
If I press the Next button it goes back to what appears to be Frame 1 and will not go to the next slide. If I press the Back button it will then go to Frame 201 and If I press next again it will go to Frame 1. It will only go back and forth in between those frames.
If I press the Back button from the beginning it goes through the slide show correctly then it gets stuck at Frame 1. If I press next button it goes to Frame 121 and gets stuck in between 121 and 1.
I can't figure this out please help.
My code on Frame 1 is:
stop();
play_btn.addEventListener(MouseEvent.CLICK,playslideshow);
function playslideshow(event:MouseEvent) { gotoAndPlay(2); }
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
gotoAndStop(40);
}
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_8);
function fl_ClickToGoToAndStopAtFrame_8(event:MouseEvent):void
{
gotoAndStop(281);
}
My code on Frame 40 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_7);
function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):void
{
gotoAndStop(121);
}
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_9);
function fl_ClickToGoToAndStopAtFrame_9(event:MouseEvent):void
{
gotoAndStop(1);
}
My code on Frame 121 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);
function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
gotoAndStop(201);
}
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_10);
function fl_ClickToGoToAndStopAtFrame_10(event:MouseEvent):void
{
gotoAndStop(40);
}
My code on Frame 201 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);
function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
{
gotoAndStop(281);
}
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_11);
function fl_ClickToGoToAndStopAtFrame_11(event:MouseEvent):void
{
gotoAndStop(121);
}
My code on Frame 281 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
{
gotoAndStop(1);
}
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_12);
function fl_ClickToGoToAndStopAtFrame_12(event:MouseEvent):void
{
gotoAndStop(201);
}


