Change event for List control : List Event « Components « Flex






Change event for List control

Change event for List control
     
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import flash.events.Event;
        public function changeEvt(event:Event):void {
            log.text=event.currentTarget.selectedItem.label + " " + event.currentTarget.selectedIndex;
        }
      
    </mx:Script>
    <mx:List width="35" change="changeEvt(event)">
        <mx:Object label="A" data="aa" />
        <mx:Object label="B" data="bb" />
        <mx:Object label="C" data="cc" />
    </mx:List>
    <mx:TextArea id="log" width="150" />
</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Adding an event listener if one isn't presentAdding an event listener if one isn't present
2.Event listener in an ActionScript function in an tagEvent listener in an ActionScript function in an <mx:Script> tag
3.List change eventList change event
4.Get selected item from a list from change eventGet selected item from a list from change event
5.Convert event target to List controlConvert event target to List control
6.Write your event listener to access the event objectWrite your event listener to access the event object
7.A data-binding watcher invokes an event listener when a binding occurs.A data-binding watcher invokes an event listener when a binding occurs.
8.List dragOver, dragDrop, dragExit eventsList dragOver, dragDrop, dragExit events
9.List double click eventList double click event
10.Add an Event Listener in MXMLAdd an Event Listener in MXML