Populating a ComboBox control using variables : ComboBox « 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 » ComboBoxScreenshots 
Populating a ComboBox control using variables
Populating a ComboBox control using variables
     
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initData();">
    <mx:Script>
        
        import mx.collections.*
        [Bindable]
        private var COLOR_ARRAY:Array = [{label:"Red", data:"#FF0000"},
                                         {label:"Green", data:"#00FF00"},
                                         {label:"Blue", data:"#0000FF"}];
        [Bindable]
        public var colorAC:ArrayCollection;
        private function initData():void {
            colorAC = new ArrayCollection(COLOR_ARRAY);
        }
      
    </mx:Script>
    <mx:ArrayCollection id="stateAC" source="{COLOR_ARRAY}" />
    <mx:ComboBox dataProvider="{colorAC}" />
</mx:Application>

   
    
    
    
    
  
Related examples in the same category
1.ComboBox open/close easing functionComboBox open/close easing function
2.Create ComboBox with static objectsCreate ComboBox with static objects
3.ComboBox-based custom componentComboBox-based custom component
4.extends the standard ComboBox control to initialize itextends the standard ComboBox control to initialize it
5.Sort ComboBox
6.Insert value to ComboBox through CursorInsert value to ComboBox through Cursor
7.Set row count for ComboBoxSet row count for ComboBox
8.Use labelFunction to provide label text for ComboBoxUse labelFunction to provide label text for ComboBox
9.Bind Image source to ComboBox
10.Pass in parameter from ComboBox to WebServicePass in parameter from ComboBox to WebService
11.Editable ComboBoxEditable ComboBox
12.Bind ComboBox and TextInput and TextBind ComboBox and TextInput and Text
13.Static ComboBoxStatic ComboBox
14.ComboBox with static String valuesComboBox with static String values
15.Simple ComboBoxSimple ComboBox
16.ComboBox component supports a closeEasingFunction style property.ComboBox component supports a closeEasingFunction style property.
17.Uses the bound propertyUses the bound property
18.Set a labelFunction for a ControlSet a labelFunction for a Control
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.