Event target id : Event Target « Event « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Event » Event TargetScreenshots 
Event target id
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>

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Get current target from eventGet current target from event
2.Pass current event target text to functionPass current event target text to function
3.Get event target labelGet event target label
4.Display current phase and information about the current targetDisplay current phase and information about the current target
5.Display the current phase and current target's IDDisplay the current phase and current target's ID
6.Use the target property not currentTarget propertyUse the target property not currentTarget property
7.Use Event object to access methods and properties of the target component, or the component that dispatched the event.Use Event object to access methods and properties of the target component, or the component that dispatched the event.
8.Check event current target class nameCheck event current target class name
9.Get event type, event target and event target idGet event type, event target and event target id
10.Check event target id
11.Let current event target show the drop feedbackLet current event target show the drop feedback
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.