ComboBox change event : ComboBox Event « Components « Flex

ComboBox change event

ComboBox change event

<mx:Application xmlns:mx="" layout="vertical" creationComplete="initHandler();">
            private var myString:String;
            private var myStringArray:Array = ["A", "B", "C"];

            private function initHandler():void
                fruitCB.dataProvider = myStringArray;
            private function isOrangeChosen():Boolean
                return myString == "Orange";

            public function get fruit():String
                return myString;
            public function set fruit( str:String ):void
                myString = str;
                dispatchEvent( new Event( "myStringValueChanged" ) );


    <mx:Label text="select a fruit:" />
        <mx:ComboBox id="fruitCB" change="{fruit = fruitCB.selectedLabel}" />
        <mx:Button label="Eat the orange." enabled="{isOrangeChosen()}" />



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.Information from ComboBox eventsInformation from ComboBox events