i have 6 buttons on my main navigation panel.

Each button plays a movieclip that brings in text information and plays a 3D animation. The animation lasts for 20 frames from start to finish. The last frame is where all the information is displayed on the main stage.

As i press any of the buttons i want Flash to check to see whether any of the other buttons have already been pressed (and the corresponding movieclip has played)

If flash finds that any of the movieclips have already been played i have an instruction to rewind the clip and play the clip relating to the button that has just been pressed. If no buttons have already been pressed then flash only plays the movieclip relating to the button pressed.


I have script that uses alot of "if" and "else if" statements looking at ._currentFrame positions and boleans set false if a clip is on frame 1 and true for any other frame.

Should i be using arrays to sort through the data more efficiently.

If so then can anyone direct me to a related tutorial or give me further instruction on the matter.

Example code on one of the buttons


//code starts here

on (release) {
if (_root.but2._currentFrame == 10) {
_root.but2.play();
play ();
} else if (_root.but2.boolbut2 == true) {
_root.but2.gotoAndStop(1);
play ();
} else if (_root.but3._currentFrame == 10) {
_root.but3.play();
play ();
} else if (_root.but3.boolbut3 == true) {
_root.but3.gotoAndStop(1);
play ();
} else if (_root.but4._currentFrame == 10) {
_root.but4.play();
play ();
} else if (_root.but4.boolbut4 == true) {
_root.but4.gotoAndStop(1);
play ();
} else if (_root.but5._currentFrame == 10) {
_root.but5.play();
play ();
} else if (_root.but5.boolbut5 == true) {
_root.but5.gotoAndStop(1);
play ();
} else if (_root.but6._currentFrame == 10) {
_root.but6.play();
play ();
} else if (_root.but6.boolbut6 == true) {
_root.but6.gotoAndStop(1);
play ();
} else {
play ();
}
}

//code ends here


In this particular script there is no use of the code that plays the movieclip backward - all this does is see whether a clip is on frame 10 and if so then it plays the clip further - frame 10 onward in each clip is a reverse of the first 10 frames.


Can any of this code be put into arrays and examined sequentially?

Any ideas would be greatly appreciated