List.selectedIndex

Availability

Flash Player 6.0.79.

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.

Example

This example selects the item after the currently selected item. If nothing is selected, item 0 is selected, as follows:

var selIndex = myList.selectedIndex;
myList.selectedIndex = (selIndex==undefined ? 0 : selIndex+1); 

See also

List.selectedIndices, List.selectedItem, List.selectedItems