Use the Collection tag to describe an array of objects that can be modified as a collection of items in the Values dialog box while authoring. The type of the objects is identified by the collectionItem attribute. A collection property contains a series of collection items that you define in a separate class. This class is either mx.utils.CollectionImpl or a subclass of it. The individual objects are accessed through the methods of the class identified by the collectionClass attribute.
The syntax for the Collection tag is as follows:
[Collection (name="name", variable="varname", collectionClass="mx.utils.CollectionImpl", collectionItem="coll-item-classname", identifier="string")] public var varname:mx.utils.Collection;
The following table describes the attributes of the Collection tag:
|
Attribute |
Type |
Description |
|---|---|---|
| name |
String |
(Required) Name that appears in the Component inspector for the collection. |
| variable |
String |
(Required) ActionScript variable that points to the underlying Collection object (for example, you might name a Collection parameter Columns, but the underlying variable attribute might be __columns). |
| collectionClass |
String |
(Required) Specifies the class type to be instantiated for the collection property. This is usually mx.utils.CollectionImpl, but it can also be a class that extends mx.utils.CollectionImpl. |
| collectionItem |
String |
(Required) Specifies the class of the collection items to be stored within the collection. This class includes its own inspectable properties that are exposed through metadata. |
| identifier |
String |
(Required) Specifies the name of an inspectable property within the collection item class that Flash uses as the default identifier when the user adds a new collection item through the Values dialog box. Each time a user creates a new collection item, Flash sets the item name to identifier plus a unique index (for example, if identifier=name, the Values dialog box displays name0, name1, name2, and so on). |
For more information, see Collection Properties.