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