Iterator.next()

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

iterator.next()

Returns

An object that is the next item in the iterator.

Description

Method; returns an instance of the next item in the iterator. You must cast this instance to the correct type.

Example

The following example uses the next() method to access the next item in a collection:

on (click) {
    var myColl:mx.utils.Collection;
    myColl = _parent.thisShelf.MyCompactDisks;
    var itr:mx.utils.Iterator = myColl.getIterator();
    while (itr.hasNext()) {
        var cd:CompactDisk = CompactDisk(itr.next());
        var title:String = cd.Title;
        var artist:String = cd.Artist;
        trace("Title: "+title+" Artist: "+artist);
    }
}

Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00003145.html