Create Cursor for array : Cursor « Components « Flex






Create Cursor for array

Create Cursor for array
      

<?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 = [{label:"A", data:"1"},
                                    {label:"B", data:"2"}, 
                                    {label:"C", data:"3"}];
        [Bindable]
        public var myAC:ArrayCollection;
        public var myCursor:IViewCursor;
        
        public function initData():void {
            myAC = new ArrayCollection(myArray);
        }
        public function testCollection():void {
            data.myCursor=myAC.createCursor();
            ta1.text="cursor is at: " + myCursor.current.label;
            var removedItem:String=String(myCursor.remove());
            ta1.text+="cursor is at: " + myCursor.current.label;
        }
      
    </mx:Script>
    <mx:ComboBox id="myCB" rowCount="7" dataProvider="{myAC}" />
    <mx:TextArea id="ta1" height="75" width="350" />
    <mx:Button label="run test" click="testCollection();" />
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Load cursor from URLLoad cursor from URL
2.Using showBusyCursor property for SWFLoaderUsing showBusyCursor property for SWFLoader
3.Creating and removing a cursorCreating and removing a cursor
4.Use CursorManager to set and remove cursorUse CursorManager to set and remove cursor
5.Use default busy cursorUse default busy cursor
6.Install and uninstall busy cursorInstall and uninstall busy cursor
7.Create a default busy cursor at a higher priority levelCreate a default busy cursor at a higher priority level
8.Set and remove busy cursorSet and remove busy cursor
9.Use custom cursor from pngUse custom cursor from png
10.Remove cursor by idRemove cursor by id
11.Use CursorManager to load png file based cursorUse CursorManager to load png file based cursor
12.CursorManager DemoCursorManager Demo
13.Define Busy CursorDefine Busy Cursor
14.Show Busy Cursor by using ActionScriptShow Busy Cursor by using ActionScript
15.Show Busy Cursor for Image loading