User Guide

126 Creating Components
ActionScript class files
In Windows: C:\Program Files\Macromedia\Flash 8\language\First Run\Classes\mx
On the Macintosh: HD/Applications/Macromedia Flash 8/First Run/Classes/mx
Overview of component structure
A component consists of a Flash (FLA) file and an ActionScript (AS) file. You can optionally
create and package other files (for example, an icon and a .swd debugging file) with your
component, but all components require a FLA and an ActionScript file. When youve finished
developing your component, you export it as a SWC file.
A Flash (FLA) file, an ActionScript (AS) file, and a SWC file
The FLA file contains a movie clip symbol that must be linked to the AS file in both the
Linkage Properties and the Component Definition dialog boxes.
The movie clip symbol has two frames and two layers. The first layer is an Actions layer and
has a
stop() global function on Frame 1. The second layer is an Assets layer with two
keyframes: Frame 1 contains a bounding box; Frame 2 contains all other assets, including
graphics and base classes, used by the component.
The ActionScript code specifying the properties and methods for the component is in a
separate ActionScript class file. This class file also declares which, if any, classes the
component extends. The name of the AS class file is the name of the component plus the “.as
extension. For example, MyComponent.as contains the source code for the MyComponent
component.