Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > DataSet component > DataSet.hasNext() | |||
Flash Player 7.
Flash MX Professional 2004.
dataSetInstance.hasNext()
A Boolean value.
Method; returns false if the current iterator is at the end of its view of the collection; otherwise, returns true.
The following example iterates over all of the items in the current view of the collection (starting at its beginning) and performs a calculation on the price property of each item.
my_ds.addItem({name:"item a", price:16});
my_ds.addItem({name:"item b", price:9});
my_ds.first();
while (my_ds.hasNext()) {
my_ds.currentItem.price *= 0.5; // Everything's 50% off!
my_ds.next();
}
for (var i in my_ds.items) {
trace(my_ds.items[i].name + ": " + my_ds.items[i].price);
}
DataSet.currentItem, DataSet.first(), DataSet.next()
Flash CS3