![MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual Download Page 17](http://html1.mh-extra.com/html/macromedia/flex-developing-components-and-themes/flex-developing-components-and-themes_manual_3388115017.webp)
Exporting components
17
About component files
When you create a new component with Flash MX 2004, you have a minimum of four files, as
follows:
*.fla file
The Flash source file that contains the symbols and skins used by the component.
*.as file
The ActionScript source class file that defines the methods and properties of the
component.
*.swc file
The compiled component file used by Flex.
*.mxml file
The Flex application file from which you invoke the component.
You must be sure to store the *.as and *.fla files in a separate directory from the *.swc and *.mxml
files. The *.as and *.fla files should not be accessible by your users, and their presence in the same
directory as the *.mxml file can cause problems with the ActionScript classpath.
About SWC files
A SWC file is a zip-like file that is generated by the Flash authoring tool, and packaged and
expanded with the PKZip archive format. It contains everything that a component needs to run
in the Flash or Flex environment.
The following table describes the contents of a SWC file:
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.
Source code
Contains one or more ActionScript files that contain a class declaration for the
component.
The source code is used only for type-checking when extending components, and is
not compiled by the authoring tool because the compiled bytecode is already in the
implementing SWF file.
The source code might contain intrinsic class definitions that contain no function
bodies and are provided only for type-checking.
Implementing
SWF files
(Required) Implements 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) Supports Live Preview in the authoring tool. If omitted, the implementing
SWF files are used for Live Preview instead. You can omit the Live Preview SWF file
in nearly all cases; include the file only if the component’s appearance depends on
dynamic data (for example, a text box that shows the result of a web service call).
Debug info
(Optional) Includes a SWD file corresponding to the implementing SWF file. The
filename is always the same as that of the SWF file, but with the extension .swd. If it is
included in the SWC file, debugging of the component is allowed. For more
information, see
“Including debugging information” on page 21
.