File
Description
Icon
(Optional) Contains the 18 x 18, 8-bit-per-pixel icon used to display a component in
the authoring tool user interface(s). If you don't supply an icon, a default icon appears
(see
Property
(Optional) Supports a custom Property inspector in the authoring tool. If omitted, the
inspector
default Property inspector is displayed to the user.
Flex includes a single SWC file that contains all the built-in components. This SWC file is
located in the flex_app_root/WEB-INF/flex/frameworks directory. In addition, you expanded a
ZIP file containing all of the individual SWC files when you prepared the Flash environment in
"Adding Flex classes and components to the Flash IDE" on page
Viewing and changing SWC file contents
To view the contents of a SWC file, you can open it using any compression utility that supports
PKZip format (including WinZip).
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, usage instructions, or the
FLA file, if you want users to have access to the component's source code.
Using SWC files
This section describes how to create and import SWC files. You should give instructions for
importing SWC files to your component users, either as a separate set of instructions or as a
Read Me file inside the SWC file.
Creating SWC files
Flash MX 2004 and Flash MX Professional 2004 create SWC files by exporting a component.
When creating a SWC file, Flash reports compile-time errors as if you were testing a Flash
application. This means that once a component is compiled as a SWC file, you can be reasonably
certain that you will not encounter runtime errors, such as type mismatches.
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).
To export a SWC file:
Select a component in the Flash Library.
1.
Right-click the item and select Export SWC File.
2.
Save the SWC file.
3.
(Optional) Postprocess the SWC file with the SWCRepair utility. This step is necessary only if
4.
your new custom component is a subclass of a component that was not included in Flash, but
is included in Flex. For more information, see
18
Chapter 1: Working with Flash MX 2004
"Adding an icon" on page
71). The icon must be a PNG file.
8.
"Using the SWCRepair utility" on page
19.
Need help?
Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?
Questions and answers