User Guide

194 Collection Properties
Exporting components that have
collections to SWC files
When you distribute a component that has a collection, the SWC file must contain the
following dependent files:
Collection interface
Collection implementation class
Collection item class
Iterator interface
Of these files, your code typically uses the Collection and Iterator interfaces, which marks
them as dependent classes. Flash automatically includes dependent files in the SWC file and
output SWF file.
However, the collection implementation class (mx.utils.CollectionImpl) and component-
specific collection item class are not automatically included in the SWC file.
To include the collection implementation class and collection item class in the SWC file,
you define private variables in your component’s ActionScript file, as the following
example shows:
// collection item class
private var collItem:CompactDisc;
// collection implementation class
private var coll:mx.utils.CollectionImpl;
For more information on SWC files, see “Understanding SWC files” on page 182.
Using a component that has a collection
property
When you use a component that includes a collection property, you typically use the Values
dialog box to establish the items in the collection.
To use a component that includes a collection property:
1. Add the component to the Stage.
2. Use the Property inspector to name the component instance.
3. Open the Component inspector and display the Parameters tab.
4. Click the line that contains the collection property, and click the magnifying glass to the
right of the line.
Flash displays the Values dialog box.