Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > DataSet component > DataSet.currentItem | |||
Flash Player 7.
Flash MX Professional 2004.
dataSetInstance.currentItem
Property (read-only); returns the current item in the DataSet collection, or null if the collection is empty or if the current iterator's view of the collection is empty.
This property provides direct access to the item in the collection. Changes made by directly accessing this object are not tracked (in the DataSet.deltaPacket property), nor are any of the schema settings applied to any properties of this object.
The following example displays the value of the name property defined in the current item in the data set named customers_ds.
customers_ds.addItem({name:"Milton", years:3});
customers_ds.addItem({name:"Mark", years:3});
customers_ds.addItem({name:"Sarah", years:1});
customers_ds.addItem({name:"Michael", years:2});
customers_ds.addItem({name:"Frank", years:2});
trace(customers_ds.currentItem.name); // Frank
Flash CS3