Get data length from ComboBox after removing the first item : ComboBox Data « Components « Flex






Get data length from ComboBox after removing the first item

Get data length from ComboBox after removing the first item
       

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="initData()">
    <mx:Script>
        
        import mx.collections.*;
        public var myArray:Array = ["A", "B", "C", "D", "E", "F"];
        
        [Bindable]
        public var myAC:ArrayCollection;
        public function initData():void {
            myAC = new ArrayCollection(myArray);
        }
        public function changeCollection():void {
            var oldLength:int = myAC.length;
        
            var removedItem:String = String(myAC.removeItemAt(0));
            
            var newLength:int=myAC.length;
            
            ta1.text =String(newLength);
        }
      
    </mx:Script>
    <mx:ComboBox id="myCB" rowCount="7" dataProvider="{myAC}" />
    <mx:TextArea id="ta1" height="75" width="300" />
    <mx:Button label="rearrange list" click="changeCollection();" />
</mx:Application>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Set data for ComboBox with dataProviderSet data for ComboBox with dataProvider
2.ComboBox and ComboBox and <mx:dataProvider>
3.Use an array of strings as ComboBox data sourceUse an array of strings as ComboBox data source
4.Use remote data providers to supply data to your ComboBox controlUse remote data providers to supply data to your ComboBox control
5.Use child tags to set ComboBox data provider to ArrayCollection objectUse child tags to set ComboBox data provider to ArrayCollection object
6.ComboBox's default property is dataProviderComboBox's default property is dataProvider
7.Add data to ComboBox when click the buttonAdd data to ComboBox when click the button
8.Reset data in ComboBoxReset data in ComboBox
9.Feed data from web service to ComboBox
10.dataProvider for ComboBoxdataProvider for ComboBox
11.Use ComboBox as the Credit card type data sourceUse ComboBox as the Credit card type data source
12.Define Label and value separately for ComboBox data bindingDefine Label and value separately for ComboBox data binding
13.ComboBox with static string array as its data sourceComboBox with static string array as its data source
14.ComboBox data with Multiple propertiesComboBox data with Multiple properties
15.ComboBox data variablesComboBox data variables
16.data provider can contain objects with multiple fieldsdata provider can contain objects with multiple fields
17.Create ComboBox from ModelCreate ComboBox from Model
18.Assign Array to ComboBox and get the length of the added arrayAssign Array to ComboBox and get the length of the added array
19.String array collection for ComboBoxString array collection for ComboBox
20.Object array for ComboBoxObject array for ComboBox
21.ArrayCollection In ComboBoxArrayCollection In ComboBox