Event type and text : Event Object « Event « Flex






Event type and text

Event type and text
           
<?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>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Pass a string and Event object to methodPass a string and Event object to method
2.Cast Event object for only property accessCast Event object for only property access
3.Pass a string and the Event object to the runMove() methodPass a string and the Event object to the runMove() method
4.Define object type as EventDefine object type as Event
5.Access SecurityErrorEvent object's text propertyAccess SecurityErrorEvent object's text property
6.Disables interactivity for events on the first and third PlotSeries objectsDisables interactivity for events on the first and third PlotSeries objects
7.Create event objectCreate event object
8.Event Object PropertiesEvent Object Properties
9.Event typeEvent type
10.Log event information to TextAreaLog event information to TextArea