User Guide
List.selectedIndex 801
Description
Property; a Boolean value that indicates whether the list is selectable (true) or not (false).
The default value is
true.
Example
The following example prevents users from selecting items in the list by setting the selectable
property to
false:
var my_list:mx.controls.List;
my_list.addItem({data:"flash", label:"Flash"});
my_list.addItem({data:"dreamweaver", label:"Dreamweaver"});
my_list.addItem({data:"coldfusion", label:"ColdFusion"});
my_list.selectable = false;
List.selectedIndex
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
listInstance.selectedIndex
Description
Property; the selected index of a single-selection list. The value is undefined if nothing is
selected; the value is equal to the last item selected if there are multiple selections. If you assign
a value to
selectedIndex, any current selection is cleared and the indicated item is selected.
Using the
selectedIndex property to change selection doesn’t dispatch a change event. To
dispatch the
change event, use the following code:
my_list.dispatchEvent({type:"change", target:my_list});