DataSet.skip()

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

dataSetInstance.skip(offSet)

Parameters

offSet An integer specifying the number of records by which to move the iterator position.

Returns

Nothing.

Description

Method; moves the current iterator's position forward or backward in the collection by the amount specified by offSet. Positive offSet values move the iterator's position forward; negative values move it backward.

If the specified offset is beyond the beginning (or end) of the collection, the iterator is positioned at the beginning (or end) of the collection.

Example

The following example positions the current iterator at the first item in the collection, moves to the next-to-last item, and performs a calculation on a field belonging to that item:

my_ds.addItem({name:"Billy", id:104, gradeLevel:4});
my_ds.addItem({name:"Carrie", id:106, gradeLevel:4});
my_ds.addItem({name:"Mally", id:112, gradeLevel:3});
my_ds.addItem({name:"Cathy", id:110, gradeLevel:4});
my_ds.addItem({name:"Bobby", id:105, gradeLevel:4});
my_ds.first();
var itemsToSkip:Number = 3;
trace(my_ds.currentItem.name); // Billy
my_ds.skip(itemsToSkip);
trace(my_ds.currentItem.name); // Mally

Flash CS3