User Guide
942 Chapter 7: Creating Components
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
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.