Play movie clip buttons that will only go forward/back in consecutive order
Hello -
I need to work out how to have buttons that will only work in a certain order. So button1 must be clicked first (play movie clip1), then button2, then button3. You can't click/play button3 before clicking/playing button1, and button2 first. And when going in reverse they can only go back one step so if on button3 they can only click button2 or continue forward by clicking button4. I've looked through forums and googled, can't find anything on how to set this up. I'd appreciate any help.
Here's what I'm currently using for buttons to play the movie clips (Count1, Count2, etc). All of this functions like I need it too except having them only play in order. I'll also need to add a reset button once I figure out how to work in order.
function stopAllCounts():void {
Count1.gotoAndStop(1);
Count2.gotoAndStop(1);
Count3.gotoAndStop(1);
Count4.gotoAndStop(1);
}
/*1st movieclip*/
Count1.stop();
function startCount1(event:MouseEvent):void {
var stopped:Boolean = Count1.currentFrame == 1 || Count1.currentFrame == Count1.totalFrames;
stopAllCounts();
if (stopped) {
addChild(Count1);
Count1.gotoAndPlay(1);
}
}
startButton1.addEventListener(MouseEvent.CLICK, startCount1);
/*2nd movieclip*/
Count2.stop();
function startCount2(event:MouseEvent):void {
var stopped:Boolean = Count2.currentFrame == 1 || Count2.currentFrame == Count2.totalFrames;
stopAllCounts();
if (stopped) {
addChild(Count2);
Count2.gotoAndPlay(1);
}
}
startButton2.addEventListener(MouseEvent.CLICK, startCount2);
stop();
/*3nd movieclip*/
etc......
