ComboBox Selected Index : ComboBox Selection « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » ComboBox SelectionScreenshots 
ComboBox Selected Index
ComboBox Selected Index
       
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
  
  <mx:Script>
    
      import mx.controls.Alert;
      private function changeHandler(event:Event):void
      {
        if (categoryList.selectedIndex == 0)
        {
          Alert.show("You selected all categories""Everything!");
        }
        else
        {
          Alert.show("You selected " + categoryList.selectedItem, "One Thing!");
        }
      
  
  </mx:Script>
  
  <mx:ComboBox id="categoryList" change="changeHandler(event)">
    <mx:dataProvider>
      <mx:String>All Categories</mx:String>
      <mx:String>A</mx:String>
      <mx:String>B</mx:String>
      <mx:String>C</mx:String>
      <mx:String>D</mx:String>
    </mx:dataProvider>
  </mx:ComboBox>
  
</mx:Application>

   
    
    
    
    
    
    
  
Related examples in the same category
1.Get selected value, state, capital and indexGet selected value, state, capital and index
2.Count item count for ComboBox selected itemCount item count for ComboBox selected item
3.Get selected item from ComboBoxGet selected item from ComboBox
4.Count the number of items in a collection between the selected item in a ComboBox control and the end of the collection, and then returns the cursor to the initial locationCount the number of items in a collection between the selected item in a ComboBox control and the end of the collection, and then returns the cursor to the initial location
5.Select a new locale from the ComboBox control.
6.Load a resource module when the user selects the locale from the ComboBox control.
www___.__j_a___v___a_2___s.__c__o___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.