User Guide

Using a component that has a collection property 965
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 953.
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.
5.
Click the Add (+) button and define a collection item.
6.
Click the Add (+), Delete (-), and arrow buttons to add, modify, move, and delete collection
items.
7.
Click OK.
For information on accessing a collection programmatically, see Accessing collection items at
runtime in a Flash application” on page 964.