Right way to enable/disable in a for loop

Hi guys,

I d’like to have your opinion about the best and effective way to enable/disable properties on a list of MC buttons.

Let’s say I got a menu of 5 MC links and I click on one of them. I want to disable the mouseEnabled propertie on it and change its color. But most important reset all the other ones.

That’s what I have so far but I feel it’s not the best thing to do:


selectedButtonId = e.target.id (get the id of the clicked button in the buttonsArray)

for (i=0, i<buttonsArray.length, i++) {
buttonsArray*.mouseEnabled = true;
Tweener...[buttonsArray*.....;
}

buttonsArray[selectedButtonId].mouseEnabled = false;
Tweener...buttonsArray[selectedButtonId]....;

By using this loop, I sadly first change the properties of the selected button (in the loop) to change them again … sounds useless and time consuming no?

Thanks!