I have 4 arrows (up, down, left, right) and wish to activate only one whilst deactivating the rest. I have cast their instance names in an array & would like to pass one as an argument to a function (to activate). But how does one select the values not in the string but in the array (to deactivate)?
I know this is incorrect yet indicates the idea:
function ArrowActive(mc:String){
var arrows = Array;
arrows = [arrowUp, arrowDown, arrowLeft, arrowRight];
// turn on active arrow
mc.gotoAndStop(2);
// turn off active arrows
for each(var a:MovieClip in arrows! indexOf(mc)){
a.gotoAndStop(1);
}
}
Many thanks