ActionScript 2.0 Components Language Reference |
|
|
|
| Collection interface > Collection.addItem() | |||
Flash Player 7.
Flash MX Professional 2004.
collection.addItem(item)
item The object to be added to the collection. If item is null, it is not added to the collection.
A Boolean value of true if the collection was changed as a result of the operation.
Method; adds a new item to the end of the collection.
The following example calls addItem():
on (click) {
import CompactDisc;
var myColl:mx.utils.Collection;
myColl = _parent.thisShelf.MyCompactDiscs;
myCD = new CompactDisc();
myCD.Artist = "John Coltrane";
myCD.Title = "Giant Steps";
var wasAdded:Boolean = myColl.addItem(myCD);
}
|
|
|
|