Components Flex



    
        
        import mx.collections.*;
        
        private var myCursor:IViewCursor;
        public function countLast(theCursor:IViewCursor):int {
            var counter:int=0;
            var mark:CursorBookmark = theCursor.bookmark;
            while (theCursor.moveNext()) {
                counter++;
            }
            theCursor.seek(mark);
            return counter;
        }
        public function countFromSelection():void {
            myCursor.findFirst(myCB.selectedItem);
            var count:int = countLast(myCursor);
            ta1.text += myCursor.current.label + " at " + count;
        }