Collection.getItemAt()

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

collection.getItemAt(index)

Parameters

index A number that indicates the location of item within the collection. This is a zero-based index, so 0 retrieves the first item, 1 retrieves the second item, and so on.

Returns

An object containing a reference to the specified collection item, or null if index is out of bounds.

Description

Method; returns an item within the collection by using its index.

Example

The following example calls getItemAt():

//...
    var myColl:mx.utils.Collection;
    myColl = _parent.thisShelf.MyCompactDiscs;
    var myCD = CompactDisc(myColl.getItemAt(0));
    if (myCD !=null) {
        trace("Retrieved " + myCD.Title);
    }
//...