initialize="initData();">
import mx.collections.*;
public var myArray:Array = ["AZ", "MA", "MZ", "MN", "MO", "MS"];
[Bindable]
public var myAC:ArrayCollection;
public function initData():void {
myAC = new ArrayCollection(myArray);
var myCursor:IViewCursor=myAC.createCursor();
var oldLength:int=myAC.length;
var removedItem:String=String(myCursor.remove());
myCursor.moveNext();
myCursor.insert("AAAAA");
myCursor.seek(CursorBookmark.LAST, 1);
myCursor.insert("BBBBB");
var sort:Sort = new Sort();
myAC.sort=sort;
myAC.refresh();
var newLength:int=myAC.length;
myCursor.findFirst("ME");
var MEMark:CursorBookmark=myCursor.bookmark;
myCursor.seek(CursorBookmark.LAST);
var lastItem:String=String(myCursor.current);
myCursor.seek(MEMark);
var MEItem:String=String(myCursor.current);
ta1.text="Start Length: " + oldLength + ". End Length: " + newLength;
ta1.text+=".\nRemoved " + removedItem;
ta1.text+=".\nLast Item is " + lastItem;
ta1.text+=".\nItem at MEMark is " + MEItem;
}
public function sortICV():void {
}
public function resetView():void {
myArray = ["AZ", "MA", "MZ", "MN", "MO", "MS"];
myAC = new ArrayCollection(myArray);
ta1.text="Reset";
}