Re: [Flashcoders] Creating Dynamic addEventListeners with AS3

2009-04-05 Thread jonathan howe
Whatever the parent of the State_XX buttons are, you can refer to them as named children of that parent. So, if it's the current class use the this keyword: this[State_ + rs[i]].addEventListener(etc...); If it's another clip, etc, just refer to it by name: someClipThatHasTheStateButtons[State_

Re: [Flashcoders] Creating Dynamic addEventListeners with AS3

2009-04-05 Thread Rob Romanek
You can try something along the lines of var stateButton = getChildByName(State_ + rs[i]); stateButton.addEventListener(MouseEvent.CLICK, StateButtonClicked); hth, Rob On 5-Apr-09, at 8:33 PM, Graham Pearson wrote: What I am trying to do is when I retrieve the recordset back from the

Re: [Flashcoders] Creating Dynamic addEventListeners with AS3

2009-04-05 Thread Hans Wichman
Might it be possible to only add a single listener to the parent for all buttons? On Mon, Apr 6, 2009 at 3:10 AM, Rob Romanek robli...@manibus.com wrote: You can try something along the lines of var stateButton = getChildByName(State_ + rs[i]); stateButton.addEventListener(MouseEvent.CLICK,