I am changing a color of a button when clicked. How every i have ten buttons. Each instance name is like this Person1… Person2 etc.
I can change the color of the button when clicked, however I want to make sure when you click on a different button, it changes the previous button back to its original color.
I know i can do this the ghetto way and list out all the buttons i want with no color each time but if later i have 50 buttons i dont want to list them. So i built a loop but the loop is not working right. Can someone help?
This code is an example of what might be on the first button:
on(release){
for(i = 0; i<11; i++){
var tmpPerson = new Color("Person"+i);
tmpPerson.setRGB(0xFFFFFF);
trace(tmpPerson);
}
//set the color for the clicked item here
var ryansNewColor = new Color("person1");
ryansNewColor.setRGB(0x003366);
}