F > FListBox.getSelectedIndex |  |

FListBox.getSelectedIndex

FListBox, FListBox.getSelectedIndex, getSelectedIndex

Availability

Flash Player 6.

Usage

    myListBox.getSelectedIndex()

Parameters

None.

Returns

An integer or `undefined`.

Description

Method; returns the index of the currently selected item in a single-selection list box, the most recently selected item in a multiple-selection list box, or `undefined` if no item is selected. To retrieve the indexes of all selected items in a multiple-selection list box, use `FListBox.getSelectedIndices`.

Example

The following code returns the index of the currently selected item in the single-section list box `nationList`.

    nationList.getSelectedIndex();

See also

`FListBox.setSelectedIndices`, `FListBox.setSelectMultiple`