F > FComboBox.addItemAt |  |

FComboBox.addItemAt

FComboBox, FComboBox.addItemAt, addItemAt

Availability

Flash Player 6.

Usage

    myComboBox.addItemAt(index, label [,data])

Parameters

`index` An integer specifying the position at which to insert the item.

`label` A string identifying the list item in the combo box.

`data` The value to associate with the list item. This parameter is optional.

Returns

Nothing.

Description

Method; adds a new item with the specified label and optional associated data to the combo box list at the specified index position. The Data parameter can be any Flash object, string, Boolean value, integer, object, or movie clip. As each item is added, the list is updated and the scroll bar is resized.

The ComboBox component uses a zero-based index, where the item at index 0 is displayed at the top of the list.

For best performance and load-time results, do not add more than 400 items in a single frame. This applies whether you are adding the items to a single combo box list or to several combo box lists.

Example

The following code adds the item `Justin` with the associated value `Ace` as the fifth item in the list of the combo box `Favorites`.

    Favorites.addItemAt(4, "Justin", Ace);

For examples of loading a large number of items, see FComboBox.addItem.

See also

`FComboBox.getItemAt`, `FComboBox.removeItemAt`, `FComboBox.replaceItemAt`, `FComboBox.setDataProvider`, `FComboBox.sortItemsBy`