I’m in a tight spot.
I have a movie which consists of 4 buttons( PLAY, PREVIOUS, NEXT and STOP)
//define variable
currentSlide = 1
//next button with the code
on (release) {
currentSlide = currentSlide+1;
if (currentSlide<=4) {
allunits.gotoAndPlay(“slide”+currentSlide);
} else {
gotoAndPlay(“end”);
}
}
//Previous button with the code
on (release) {
currentSlide = currentSlide-1;
if (currentSlide<=0) {
allunits.gotoAndPlay(“slide”+currentSlide);
} else {
gotoAndPlay(“start”);
}
}
//Play button
currentSlide = currentSlide + 1
These buttons work correctly and advance or reverse in sequencial order (slide1,slide2,slide3,slide4). However the movie can run from start to finish wihtout the use of the navigation.
My problem is that if I let the movies run independently and then choose to use the next button while(for example) “slide3” is playing, the movie jumps to “slide1”. Note that these slide labels are located within movieclip named “allunits”
I know that the variable currentSlide is still equal to 1 thus returning the playhead to label “slide1”.
I need help targeting the correct slide#
Can anyone help!
Thanks