User Guide

Building your first component 129
14. In the Assets layer, select Frame 2 and drag an instance of UIComponent to the Stage.
15. Close the StandardComponents.fla library.
16. Select File > Import > Open External Library and select the DialAssets.fla file.
In Windows: C:\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\Components\DialComponent\DialAssets.fla.
On the Macintosh: HD/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/Components/DialComponent/DialAssets.fla
17. In the Assets layer, select Frame 2 and drag an instance of the DialFinal movie clip from
the DialAssets library to the Stage.
All the component assets are added to Frame 2 of the Assets layer. Because Frame 1 of the
Actions layer has a
stop() global function, the assets in Frame 2 will not be seen as they
are arranged on the Stage.
You add assets to Frame 2 for two reasons:
So that all assets and sub assets are automatically copied into the library and are
available to instantiate dynamically (in the case of DialFinal), or to access their
methods, properties, and events (in the case of UIComponent).
Placing assets in a frame ensures that they are loaded more smoothly as the movie is
streamed, so you dont need to set the library assets to export in the first frame. This
approach prevents an initial spike of data transfer while downloading.
18. Close the DialAssets.fla library.
19. In the Assets layer, select Frame 1. Drag the BoundingBox movie clip from the library
(Flash UI Components 2 > Component Assets folder) to the Stage. Name the
BoundingBox instance boundingBox_mc. Use the Info panel to set both the height and
width of the DialFinal movie clip to 250 pixels, and the x, y coordinates at 0, 0.
The BoundingBox instance is used to create the components live preview and resize
during authoring. You must set the size of the bounding box so that it can enclose all the
graphical elements in your component.
20.Select the Dial movie clip in the library, and select Component Definition from the Library
context menu (Windows: Right-click; Mac: control-click).
NOTE
If you are extending a component (including any version 2 component) you must
keep any instance names already in use by that component because its code will
refer to those instance names. For example, if you include a version 2 component
that is already using the instance name boundingBox_mc, you should not rename it.
For your own instance names, you can use any unique name that does not conflict
with an existing one within the same scope.