Hey guys!
i am newy to AS3, i have four buttons instances (of same object) on the stage (first_btn,second_btn…fourth_btn). i created an array (btnArray) and stored buttons instance name in it. After this i created an timer event to cycle through all the button for certain interval.
the code is:-
function timerListener(e:TimerEvent): void {
while ( i <= (btnArray.length - 1)) {
trace(btnArray*);
i++;
if (i==4) {
//first_btn.upState = first_btn.overState;
i=0;
}
break;
//btnArray*.upState = btnArray*.overState;
}
}
Now the problem is, I want to change the button state from upState to overState
but this cmd , btnArray*.upState = btnArray*.overstate is giving an error, however whenever i use instance name directly
first_btn.upState = first_btn.overState it is working fine.
I am trying to structure my project such that if i need to add more buttons then i just need to add their instance name in the array, But i am unable to figure out how to use array index notation to specify instance name in AS3… Kindly reply…