Create List from Objects : List « Components « Flex






Create List from Objects

Create List from Objects
     

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import flash.events.Event;
        public function changeEvt(event:Event):void {
            log.text=event.currentTarget.selectedItem.label + " " + event.currentTarget.selectedIndex;
        }
      
    </mx:Script>
    <mx:List width="35" change="changeEvt(event)">
        <mx:Object label="A" data="aa" />
        <mx:Object label="B" data="bb" />
        <mx:Object label="C" data="cc" />
    </mx:List>
    <mx:TextArea id="log" width="150" />
</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Populating List using ActionScriptPopulating List using ActionScript
2.Using a List component to display a single column of namesUsing a List component to display a single column of names
3.Create a static List controlCreate a static List control
4.Set the verticalAlign for ListSet the verticalAlign for List
5.Set the variableRowHeight for ListSet the variableRowHeight for List
6.Set wordWrap and variableRowHeightSet wordWrap and variableRowHeight
7.Remove from ListRemove from List
8.Remove an item from listRemove an item from list
9.Replace item in a ListReplace item in a List
10.Call JavaScript when double clicked the List itemCall JavaScript when double clicked the List item
11.Set Icons for Items in a ListSet Icons for Items in a List
12.Double click to edit ListDouble click to edit List
13.Spark List Caret IndexSpark List Caret Index
14.Spark List with alternating Item ColorsSpark List with alternating Item Colors
15.List rollover colorList rollover color
16.List IconList Icon
17.A List control uses the iconFunction property to determine the icon to display for each itemA List control uses the iconFunction property to determine the icon to display for each item
18.Give a list of color namesGive a list of color names
19.If items do not fit in the size of the control, Flex automatically display scroll barsIf items do not fit in the size of the control, Flex automatically display scroll bars