Event Flex



    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx">
    
        
    

    
         
        import spark.events.IndexChangeEvent; 
        // Event handler to determine if the selected item is new. 
        protected function myCB_changeHandler(event:IndexChangeEvent):void 
        { 
                // Determine if the index specifies a new data item. 
                if(myCB.selectedIndex == spark.components.ComboBox.CUSTOM_SELECTED_ITEM) 
                    // Add the new item to the data provider. 
                    myCB.dataProvider.addItem(myCB.selectedItem); 
        } 
      
    

    
    
    
        
            
                Red
                Orange
                Yellow
                Blue
                Green