User Guide

954 Chapter 7: Creating Components
The following table describes the contents of a SWC file:
You can optionally include other files in the SWC file, after you generate it from the Flash
environment. For example, you might want to include a Read Me file, or the FLA file if you want
users to have access to the component’s source code. To add additional files, use the Macromedia
Extension Manager (see www.macromedia.com/exchange/em_download/).
SWC files are expanded into a single directory, so each component must have a unique file name
to prevent conflicts.
Exporting SWC files
Flash MX 2004 and Flash MX Professional 2004 provide the ability to export SWC files by
exporting a movie clip as a SWC file. When exporting a SWC file, Flash reports compile-time
errors as if you were testing a Flash application.
There are two reasons to export a SWC file:
To distribute a finished component
To test during development
File Description
catalog.xml (Required) Lists the contents of the component package and its individual
components, and serves as a directory to the other files in the SWC file.
ActionScript
(AS) files
If you create the component with Flash MX Professional 2004, the source code is
one or more ActionScript files that contain a class declaration for the component.
The compiler uses the source code for type checking when a component is
extended. The AS file is not compiled by the authoring tool because the compiled
bytecode is already in the implementing SWF file.
The source code may contain intrinsic class definitions that contain no function
bodies and are provided purely for type checking.
SWF files (Required) SWF files that implement the components. One or more components
can be defined in a single SWF file. If the component is created with Flash MX 2004,
only one component is exported per SWF file.
Live Preview
SWF files
(Optional) If specified, these SWF files are used for live preview in the authoring tool.
If omitted, the SWF files that implement the component are used for live preview
instead. The Live Preview SWF file can be omitted in nearly all cases; it should be
included only if the component’s appearance depends on dynamic data (for
example, a text field that shows the result of a web service call).
SWD file (Optional) A SWD file corresponding to the implementing SWF file that allows you
to debug the SWF file. The filename is always the same as that of the SWF file, but
with the extension .swd.
PNG file (Optional) A PNG file containing the 18 x 18, 8-bit-per-pixel icon that you use to
display a component icon in the authoring tool user interfaces. If no icon is supplied, a
default icon is displayed. (See “Adding an icon” on page 956.)
Property
inspector
SWF file
(Optional) A SWF file that you use as a custom Property inspector in the authoring
tool. If you omit this file, the default Property inspector is displayed to the user.