Add event listeners in a loop?
Hi
If I have a movieclip I instantiated, called _aBet, and within that clip it has child clips named A, B, C etc
and I have an array...
aBetARR = new Array("A","B","C","D","E"... etc
How, in a loop, do you add an event listener for each of the child clips? Is it possible?
for( var i:int=0; i<aBetARR.length; i++ ) {
_abet.[aBetARR].addEventListener(MouseEvent.CLICK, hE);
}
I've done this elsewhere in the project where I reference the actual child clips of an MC called _help in an array...
helpARR = new Array( _help.needAccount, _help.register, ...etc
for( var i:int=0; i<helpARR.length; i++ ) { helpARR.addEventListener(MouseEvent.CLICK, helpFunc); }
But is it possible to do the same using a string as a part of the reference?
Thanks guys