User Guide
Overview of component structure 917
Overview of component structure
A component is comprised of a Flash (FLA) file and an ActionScript (AS) file. There are other
files (for example, an icon and a .swd debugging file) that you can optionally create and package
with your component, but all components require a FLA and an ActionScript file. When you’ve
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() action on Frame 1. The second layer is an Assets layer with two keyframes. Frame 1
contains a bounding box or any graphics that serve as placeholders for the final art. Frame 2
contains all other assets, including graphics and base classes, used by the component.
The ActionScript code specifies the properties and methods for the component, and specifies
which, if any, classes the component extends. The name of the AS file is the name of the
component. For example, MyComponent.as contains the source code for the MyComponent
component.
It’s a good idea to save the component’s FLA and AS files in the same folder and give them the
same name. If the AS file is not saved in the same folder, you must verify that the folder is in the
classpath so the FLA file can find it. For more information about the classpath, see
“Understanding the classpath” in Using ActionScript in Flash.