Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Creating Components > Building your first component > Creating the Dial Flash (FLA) file | |||
The first steps for creating a component include creating the component movie clip within a FLA document file.
The file can have any name, but giving it the same name as the component is practical.
Name the component Dial, and assign it the behavior Movie clip.
Flash changes to symbol-editing mode.
This is the structure of the component movie clip: an Actions layer and an Assets layer. The Actions layer has one keyframe and the Assets layer has two keyframes.
stop(); global function. This prevents the movie clip from proceeding to Frame 2.
|
NOTE |
|
For information about folder locations, see "Configuration folders installed with Flash" in Using Flash. |
Asset dependencies are automatically copied to the Dial library with UIComponent.
|
NOTE |
|
When you drag UIComponent to the Dial library, the folder hierarchy in the Dial 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.fla library so that it's organized well and you avoid duplicate symbols. |
For a sample of the DialAssets.fla file, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.
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:
The BoundingBox instance is used to create the component's 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.
|
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. |
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.
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002485.html
Comments
Rocket Ron said on Jul 18, 2007 at 9:27 AM : frebro said on Mar 5, 2008 at 1:28 AM :