List.replaceItemAt()

Availability

Flash Player 6.0.79.

Edition

Flash MX 2004.

Usage

listInstance.replaceItemAt(index, label[, data])
listInstance.replaceItemAt(index, itemObject)

Parameters

index A number greater than zero and less than List.length that indicates the position at which to insert the item (the index of the new item).

label A string that indicates the label for the new item.

data The data for the item. This parameter is optional and can be of any type.

itemObject. An object to use as the item, usually containing label and data properties.

Returns

Nothing.

Description

Method; replaces the content of the item at the index specified by the index parameter.

Calling this method modifies the data provider of the List component. If the data provider is shared with other components, those components will update as well.

Example

The following example changes the fourth index position:

myList.replaceItemAt(3, "new label");