ActionScript 2.0 Components Language Reference |
|
|
|
| ComboBox component > ComboBox.getItemAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
comboBoxInstance.getItemAt(index)
index The index of the item to retrieve. The index must be a number greater than or equal to 0, and less than the value of ComboBox.length.
The indexed item object or value. The value is undefined if the index is out of range.
Method; retrieves the item at a specified index.
With a ComboBox component instance my_cb on the Stage, the following ActionScript displays the label for the first combo box item in the Output panel:
//Add Item to List.
my_cb.addItem({data:1, label:"First Item"});
my_cb.addItem({data:2, label:"Second Item"});
trace(my_cb.getItemAt(1).label);
|
|
|
|