Information from ComboBox events : ComboBox Event « Components « Flex

Information from ComboBox events

Information from ComboBox events
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit


<!-- dpcontrols/ComboBoxEvent.mxml -->
<s:Application xmlns:fx=""
    xmlns:s="library://" xmlns:mx="library://">
        <s:VerticalLayout />
        // Display the type of event for open and close events. 
        private function dropEvt(event:DropdownEvent):void { 
            forChange.text+=event.type + "\n"; 
        // Display a selected item's label field and index for change events. 
        private function changeEvt(event:Event):void { 
            forChange.text+=event.currentTarget.selectedItem.label + " " + 
                event.currentTarget.selectedIndex + "\n"; 
    <mx:ComboBox open="dropEvt(event)" close="dropEvt(event)"
            <fx:Object label="AL" data="Montgomery" />
            <fx:Object label="AK" data="Juneau" />
            <fx:Object label="AR" data="Little Rock" />
    <mx:TextArea id="forChange" width="150" height="150" />


Related examples in the same category

1.Open event for ComboBoxOpen event for ComboBox
2.Close event for ComboBoxClose event for ComboBox
3.Change event for ComboBoxChange event for ComboBox
4.Use changeEvent to display valueUse changeEvent to display value event and change event for ComboBoxopen event and change event for ComboBox
6.ComboBox change eventComboBox change event