Set List selected item : List Selection « Components « Flex






Set List selected item

Set List selected item
           

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:VBox>
        <mx:List id="list" width="100">
            <mx:ArrayCollection>
                <mx:Array>
                    <mx:String>a</mx:String>
                    <mx:String>b</mx:String>
                    <mx:String>c</mx:String>
                    <mx:String>d</mx:String>
                </mx:Array>
            </mx:ArrayCollection>
        </mx:List>
        <mx:NumericStepper id="stepper" minimum="0" maximum="3" change="list.selectedIndex = stepper.value" />
    </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Selected item and selected index from ListSelected item and selected index from List
2.Using binding to capture the selection of a List-based componentUsing binding to capture the selection of a List-based component
3.Set selected index for ListSet selected index for List
4.Set selection color for ListSet selection color for List
5.Spark List Selection change listenerSpark List Selection change listener
6.Enable multiple selection for the List controlEnable multiple selection for the List control