Mega Code Archive

 
Categories / Flex / Event
 

Event target id

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">     <mx:Script>                      import mx.controls.*;             private function clickHandler(event:MouseEvent):void{                 myLabel.text = event.type + ": " + myInput.text;                 Alert.show("Text Entered by the\n" + event.target.id + " button.","Alert Box", Alert.OK);             }                   </mx:Script>     <mx:TextInput id="myInput" width="150"/>     <mx:Label id="myLabel" width="150"/>     <mx:Button id="myButton1" label="myButton1" click="clickHandler(event)"/>     <mx:Button id="myButton2" label="myButton2" click="clickHandler(event)"/> </mx:Application>