Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Creating Components > Creating the ActionScript class file > Adding component metadata > About the Collection tag | |||
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.
A collection property in the Component inspector and the Values dialog box that appears when you click the magnifying glass.
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 |
collectionClass
|
String |
(Required) Specifies the class type to be instantiated for the collection property. This is usually |
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 |
For more information, see Collection Properties.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002503.html