List.getItemAt()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

listInstance.getItemAt(index)

Parameters

index A number greater than or equal to 0, and less than List.length. It specifies the index of the item to retrieve.

Returns

The indexed item object; undefined if the index is out of range.

Description

Method; retrieves the item at the specified index. This method gets the data item either from an array, DataProvider, or from a data object created with CellRenderer.setValue().

Example

The following code displays the label of the item at index position 2. To try this code, drag a List component to the Stage and give it the instance name my_list. Add the following code to Frame 1 in the timeline:

var my_list:mx.controls.List;

my_list.addItem({data:'flash', label:'Flash'});
my_list.addItem({data:'dreamweaver', label:'Dreanweaver'});
my_list.addItem({data:'coldfusion', label:'ColdFusion'});

trace(my_list.getItemAt(2).label);