Get event type, event target and event target id
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
private function clickHandler(evt:Event):void
{
myText.text="button clicked";
myText.text+= "Event type: " + evt.type;
myText.text+= "Event Target: " + evt.target;
myText.text+= "Event Target ID: " + evt.target.id;
}
</mx:Script>
<mx:Panel title="Using the Event Object" width="240" height="282">
<mx:TextArea width="100%" height="100%"
id="myText" text="click something please !"/>
<mx:HBox>
<mx:Button id="myButton"
label="Click Me"
click="clickHandler(event)"/>
</mx:HBox>
</mx:Panel>
</mx:Application>
Related examples in the same category