F > FComboBox.replaceItemAt |
![]() ![]() ![]() |
FComboBox.replaceItemAt
Availability
Flash Player 6.
Usage
myComboBox
.replaceItemAt(
index, label
[,data
])
Parameters
index
An integer specifying the position of a list item.
label
A string specifying a new label for the list item.
data
The new value to associate with the list item. This parameter is optional; if you don't specify it, any data currently specified for the item remains in place.
Returns
Nothing.
Description
Method; updates the item at the specified index with the specified label and data. If the item at the specified index has an associated data value and you do not specify a value for the data
parameter, the data value of the list item is not changed.
The ComboBox component uses a zero-based index, where the item at index 0 is displayed at the top of the list.
Example
The following code updates the fifth item in the combo box Favorites
with the label Nigel
and data value 7439
. If no data was specified for the list item, Nigel
assumes the data value of the existing list item.
Favorites
.replaceItemAt(4, "Nigel", "7439");
See also
FComboBox.addItemAt
, FComboBox.getItemAt
, FComboBox.setDataProvider
, FComboBox.sortItemsBy
![]() ![]() ![]() |