User Guide
Table Of Contents
- Contents
- Working with Flash MX 2004
- Creating Basic Components in Flash MX 2004
- Creating Advanced Components in Flash MX 2004
- Contents
- About Creating components
- Writing the component’s ActionScript code
- Simple example of a class file
- General process for writing a class file
- Selecting a parent class
- Identifying the class, symbol, and owner names
- About the component instantiation life cycle
- Writing the constructor
- Specifying clip parameters
- Implementing the constructObject2() method
- Implementing the init() method
- Implementing the createChildren() method
- Implementing the commitProperties() method
- Implementing the measure() method
- Implementing the layoutChildren() method
- Implementing the draw() method
- Defining getters and setters
- Component metadata
- Defining component parameters
- Handling events
- Using the Event metadata
- About invalidation
- Skinning custom controls
- Adding styles
- Making components accessible
- Improving component usability
- Best practices when designing a component
- Using the ModalText example
- Troubleshooting
- Index

22 Chapter 1: Working with Flash MX 2004
Importing SWC files into the Flash IDE
SWC files are a convenient way to share components among Flash developers. After you create a
SWC file, you can give that SWC component to anyone else with Flash and they can use your
component in their applications. Flash authors can use custom SWC components as they would
any other component in the Flash Library.
Note: After you create a SWC file, you can rename the file, but the tag name you use in your MXML
file must match the Linkage Identifier in the original FLA file (or the symbolName in the class file).
When you distribute your components to other developers, you can include the following
instructions so that they can install and use them immediately.
To use a SWC file in the Flash authoring environment:
1.
Copy the SWC file into the Flash_root/en/First Run/Components directory.
2.
Start the Flash authoring environment or reload the Components panel if it was already
running. To reload the component list on the Components panel, click the menu button and
select Reload.
The component’s icon appears in the Components panel. You can now use the component as if
it were any of the built-in components.