I would use option 2, it's clean.
Give your graphics (movie clips) instance names which are sequential, like "graphic1", "graphic2", etc.
Then use a loop and a function. So on the first frame of you movie have this function:
function hideThem (button) {
for (x=1; x<5; x++) {
if (x != button) {
_root["graphic"+x]._visible = false;
} else {
_root["graphic"+x]._visible = true;
}
}
}
hideThem()
This function takes one argument; the number of the graphic you want to display, and hides all graphics but that one. Given no argument it hides all graphics so on the first frame you run it with no arguments:
_root.hideThem()
This will make all your graphics invisible. Then make your buttons have code like this:
on (release) {
hideThem(Z);
}
Where 'Z' is a number indicating which graphic you wish to show. All other graphics will be hidden
Cheers
Jesse
__________________
Cheers
Jesse Stratford
ActionScript.org Cofounder
Please don't email or PM me Flash questions, that's what the Forums are for!
Please don't rely on me reading my PMs either. Email me about important stuff.
|