Change event for ComboBox
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import flash.events.Event;
import mx.events.DropdownEvent;
private function dropEvt(event:DropdownEvent):void {
forChange.text+=event.type + "\n";
}
private function changeEvt(event:Event):void {
forChange.text+=event.currentTarget.selectedItem.label + " " + event.currentTarget.selectedIndex + "\n";
}
</mx:Script>
<mx:ComboBox open="dropEvt(event)" close="dropEvt(event)" change="changeEvt(event)">
<mx:ArrayCollection>
<mx:Object label="A" data="AA" />
<mx:Object label="B" data="BB" />
<mx:Object label="C" data="CC" />
</mx:ArrayCollection>
</mx:ComboBox>
<mx:TextArea id="forChange" width="150" height="100%" />
</mx:Application>
Related examples in the same category