Choose File > Import > Open External Library and choose the StandardComponents.fla file
11.
from the FirstRun/ComponentFLA folder.
Dial extends the UIComponent base class; therefore, you must drag an instance of the
UIComponent class into the Dial document.
Note: For information about folder locations, see "Configuration folders installed with Flash" in
Using Flash.
In the StandardComponents library, browse to the UIComponent movie clip in the following
12.
folders: Flash UI Components 2 > Base Classes > FUIObject Subclasses and drag it to the
Dial.fla library.
Other assets are copied to the Dial library with UIComponent.
Note: When you drag UIComponent to the Dial library, the folder hierarchy in the library is
changed. If you plan to use your library again, or use it with other groups of components (such as
the version 2 components), you should restructure the folder hierarchy to match the
StandardComponents library so that it's organized well and you avoid duplicate symbols.
Close the StandardComponents library.
13.
In the Assets layer, select Frame 2 and drag an instance of UIComponent to the Stage.
14.
Choose File > Import > Open External Library and choose the DialAssets.fla file from the
15.
Macromedia/Flash MX 2004/Samples/HelpExamples/DialComponent folder.
In the Assets layer, select Frame 2 and drag an instance of the DialFinal movie clip from the
16.
DialAssets library to the Dial library.
All the component assets are added to Frame 2 of the Assets layer. Because there is a
action on Frame 1 of the Actions layer, the assets in Frame 2 won't be seen as they are arranged
on the Stage. You add them to Frame 2 so that they exist in the component library and you can
instantiate them dynamically (in the case of DialFinal), or access their methods, properties, and
events (in the case of UIComponent).
In the Assets layer, select Frame 1. Drag the BoundingBox movie clip from the library (Flash
17.
UI Components 2 > Component Assets folder) to the Stage. Give the BoundingBox the
instance name boundingBox_mc. Use the Info panel to resize it to the size of the DialFinal
movie clip (250, 250), and position it at 0, 0.
The BoundingBox instance is used to create the component's live preview and handle resizing
during authoring. You must size the bounding box so that it can enclose all the graphical
elements in your component.
Note: If you are extending a component (including any version 2 component) that uses the
instance name
boundingBox_mc
name.
Select the Dial movie clip in the library, and choose Component Definition from the Library
18.
options menu.
In the AS 2.0 Class text box, enter Dial.
19.
This value is the name of the ActionScript class. If the class is in a package, the value is the full
package, for example, mx.controls.CheckBox.
Save the file.
20.
, you must use that name too. Otherwise, you can use any instance
Building your first component
stop()
919
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers