DataSet.iteratorScrolled

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

Usage 1:

var listenerObject:Object = new Object();
listenerObject.iteratorScrolled = function (eventObj:Object) {
    // ...
};
dataSetInstance.addEventListener("iteratorScrolled", listenerObject);

Usage 2:

on (iteratorScrolled) {
    // ...
}

Description

Event; generated immediately after the current iterator has scrolled to a new item in the collection.

The event object (eventObj) contains the following properties:

target The DataSet object that generated the event.

type The string "iteratorScrolled".

scrolled A number that specifies how many items the iterator scrolled; positive values indicate that the iterator moved forward in the collection; negative values indicate that it moved backward in the collection.

Example

In the following example, the status bar of an application (not shown) is updated when the position of the current iterator changes:

my_ds.addItem({name:"Milton", years:3});
my_ds.addItem({name:"Mark", years:3});
my_ds.addItem({name:"Sarah", years:1});
my_ds.addItem({name:"Michael", years:2});
my_ds.addItem({name:"Frank", years:2});

my_ds.addEventListener("iteratorScrolled", iteratorScrolledListener);

my_ds.first(); // Trigger the iteratorScrolled event.

function iteratorScrolledListener(evt_obj:Object):Void {
    trace("The iterator was scrolled.");
}

Flash CS3