User Guide

308 Chapter 6: Components Dictionary
DataSet.addItem()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.addItem([obj])
Parameters
obj
An object to add to this collection. This parameter is optional.
Returns
A Boolean value: true if the item was added to the collection, false if it was not.
Description
Method; adds the specified record (transfer object) to the collection for management. The newly
added item becomes the current item of the data set. If no
obj parameter is specified, a new
object is created automatically by means of
DataSet.createItem().
The location of the new item in the collection depends on whether a sort has been specified for
the current iterator. If no sort is in use, the item is added to the end of the collection. If a sort is in
use, the item is added to the collection according to its position in the current sort.
For more information on initialization and construction of the transfer object, see
DataSet.createItem().
Example
The following example uses DataSet.createItem() to create a new item and add it to the data
set:
myDataSet.addItem(myDataSet.createItem());
See also
DataSet.createItem()
DataSet.addItemAt()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
DataSetInstance.addItemAt(index, item)