I’ve got a bunch of yellow highlights that I need to turn off and on with a button, so I’m using an array, but can’t seem to get it to work. I know it’s mostly right because the initial state, with alpha at 0, works fine, but the “if/else if” statement that turns them on and off isn’t taking. Here’s my code:
hilites = ["F16", "F17", "F20", "F22", "F23", "F24", "F26", "F27", "F28", "C14", "C15", "C16", "C17", "C18", "C20", "C22", "C23", "C24", "C27", "C29", "C30", "C31", "C32", "C33", "C51", "C57", "W11", "W12", "W13", "W14", "W16", "W21", "W23"]
for(i=0; i<hilites.length; i++){
var btn:MovieClip = draggable_mc[hilites*+"Hilite_mc"];
btn._alpha = 0;
fricewBtn_mc.onRollOver = function(){
this.gotoAndStop("over");
};
fricewBtn_mc.onPress = function(){
this.gotoAndStop("down");
};
fricewBtn_mc.onRollOut = function(){
this.gotoAndStop("off");
};
fricewBtn_mc.onRelease = function(){
if (btn._alpha == 0)
{
btn._alpha = 100;
}
else if (btn._alpha == 100)
btn._alpha = 0;
;
this.gotoAndStop("on");
};
};
Any comments welcome!