Data Model Flex


    initialize="sortAC()">
    
        
        import mx.collections.*;
        public function sortAC():void {
            var sortA:Sort = new Sort();
            sortA.fields=[new SortField("label")];
            myAC.sort=sortA;
            myAC.refresh();
        }
        public function addItemToMyAC():void {
            myAC.addItem({label:"MD", data:"Annapolis"});
        }