User Guide
190 Collection Properties
// You must code a reference to the collection item class
// to force the compiler to include it as a dependency
// within the SWC
private var collItem:CompactDisc;
// You must code a reference to the mx.utils.CollectionImpl class
// to force the compiler to include it as a dependency
// within the SWC
private var coll:mx.utils.CollectionImpl;
// required methods for all classes
function init(Void):Void {
super.init();
}
function size(Void):Void {
super.size();
}
}
To create a FLA file to accompany this class for testing purposes:
1. In Flash, select File > New and create a Flash document.
2. Select Insert > New Symbol. Give it the name, linkage identifier, and AS 2.0 class
name MyShelf.
3. Deselect Export in First Frame and click OK.
4. Select the MyShelf symbol in the library and choose Component Definition from the
Library options menu. Enter the ActionScript 2.0 class name MyShelf.
5. Select Window > Common Libraries > Classes, and drag UtilClasses to the library of
MyShelf.fla.
6. In the MyShelf symbol’s Timeline, name one layer Assets. Create another layer and name
it Actions.
7. Place a stop() function on Frame 1 in the Actions layer.
8. Select Frame 2 in the Assets layer and select Insert > Timeline > Keyframe.
9. Open StandardComponents.fla from the Configuration/ComponentFLA folder, and drag
an instance of UIObject to the Stage of MyShelf in Frame 2 of the Assets layer.
You must include UIObject in the component’s FLA file because, as you can see in the
above class file, MyShelf extends UIObject.
10. In Frame 1 of the Assets layer, draw a shelf.
This can be a simple rectangle; it’s just a visual representation of the MyShelf component
to use for learning purposes.
11. Select the MyShelf movie clip in the library, and select Convert to Compiled Clip.