F > FComboBox.getSelectedItem |
FComboBox.getSelectedItem
FComboBox, FComboBox.getSelectedItem, getSelectedItem
Availability
Flash Player 6.
Usage
myComboBox.getSelectedItem()
Parameters
None.
Returns
An object or undefined.
Description
Method; returns the currently selected item as an object with the properties label and data, or returns undefined if no item is selected.
Example
The following code retrieves the label and data of the item currently selected in comboBox1.
trace(comboBox1.getSelectedItem());
The following code retrieves the label of the item currently selected in comboBox2.
trace(comboBox2.getSelectedItem().label);
The following code retrieves the data of the item currently selected in comboBox3.
trace(comboBox3.getSelectedItem().data);
See also