03-17-2011 06:35 AM
Alright, I'm in a pickle. I want to Click a button (A label to be exact).
So I've got my Label
I've got and event listener for the label click
And now I want to take the Text String of the label and use it in a dispatch event while sending a page change event (2 dispatch events at once to a 2nd page)
On this second page I Need to know what the string of the button pressed was so I can further process events.
Basically this is my event flow:
I have everything working perfect except for the string button dilemma. There will be many buttons (rather labels) involved.
Solved! Go to Solution.
03-17-2011 07:43 AM
Every event has a "target" attribute. The target is the object that originally dispatched the event. For example, a LabelButton dispatches an event on click, you can cast the target back to that object to know some things about that target (assuming the target is still in memory).
private function ButtonClicked( event : Event ) : void
trace( 'button ' + LabelButton( event.target ).label );
If you are passing an intermediate event and you want to carry information with that event, then you can create your own Event class by extending the base Event class and adding attributes that you want to carry along. You may also want to look at the meta event class which allows you to attach meta information with the event class being dispatched.
03-17-2011 07:50 AM
03-17-2011 09:43 AM - edited 03-17-2011 09:47 AM
nvm this post