Hello, I have a panel with a textInput and a button.
I want to get a reference to the Panel as each of these two components is clicked.
I can identify the Panel of the button easily via event.target.parent.
However when I click on the textInput component the event.target returns the UITextField that is nested within the textInput, therfore 'event.target.parent' does not return the panel.
Is there any way I can get a reference to the panel when I click on the textInput(UITextField child) component ?
Is there a more elegant/efficient way than using something like 'event.target.parent.parent' ?
Thanks for any help.
If this post answers your question or helps, please mark it as such.
no, sorry I forgot to mention my currentTarget is Stage.
Thanks for your assitance though.
Does anyone else have any ideas ?
If you listen to the Panel instead of the stage, then currentTarget will be the Panel.
You can try event.target.document. Should work for most MXML declared UI widgets. You might have to maintain it yourself for AS created components.
Flex SDK Developer
Adobe Systems Inc.