quanticchaos
10-27-2008, 04:28 PM
Hello.
I am building a simple menu that has 5 buttons. Each button instance is named "boton1, boton2..." These buttons are movie clips with various states and motions.
After releasing the button, a movie clip runs and the button position changes.
The script i made (above) pretended to make the actual "pressed" button return to it's normal position when pressing another button, calling the function "cebot();" with the actual button number ("cebot(1);").
Everything works great but it seems i cannot use the array in "_root.menu1.ARRAY.gotoAndPlay();"
I am a noob and i don't even know how to google this.
So please could you tell me how could i do this ?
I would also like to use these arrays to label the buttons ( _root.menu1.botones[0].thelabel = "The label";) but there too, it doesn't work..
This is the code i tried to use:
function cebot(cual) {
var botones:Array = ["boton1", "boton2", "boton3", "boton4", "boton5"];
for(bt = 1; bt <= 5; bt++) {
if(bt != cual) { _root.menu1.botones[bt-1].gotoAndPlay(11); };
}
}
Everything works great if i change "botones[number]" by the instance name (boton1, etc...)
Thanks in advance.
I am building a simple menu that has 5 buttons. Each button instance is named "boton1, boton2..." These buttons are movie clips with various states and motions.
After releasing the button, a movie clip runs and the button position changes.
The script i made (above) pretended to make the actual "pressed" button return to it's normal position when pressing another button, calling the function "cebot();" with the actual button number ("cebot(1);").
Everything works great but it seems i cannot use the array in "_root.menu1.ARRAY.gotoAndPlay();"
I am a noob and i don't even know how to google this.
So please could you tell me how could i do this ?
I would also like to use these arrays to label the buttons ( _root.menu1.botones[0].thelabel = "The label";) but there too, it doesn't work..
This is the code i tried to use:
function cebot(cual) {
var botones:Array = ["boton1", "boton2", "boton3", "boton4", "boton5"];
for(bt = 1; bt <= 5; bt++) {
if(bt != cual) { _root.menu1.botones[bt-1].gotoAndPlay(11); };
}
}
Everything works great if i change "botones[number]" by the instance name (boton1, etc...)
Thanks in advance.