A SWC file is an archive file for Flex components and other assets. SWC files contain a SWF file and a catalog.xml file. The SWF file inside the SWC file implements the compiled component or group of components and includes embedded resources as symbols. Flex applications extract the SWF file from a SWC file, and use the SWF file's contents when the application refers to resources in that SWC file. The catalog.xml file lists of the contents of the component package and its individual components.
You compile SWC files by using the component compilers. These include the compc command-line compiler and the Flex Builder Library Project compiler. SWC files can be component libraries, RSLs, theme files, and resource bundles.
To include a SWC file in your application at compile time, it must be located in the library path. For more information about SWC files, see About SWC files.
A component library is a SWC file that contains classes and other assets that your Flex application uses. The component library's file structure defines the package system that the components are in.
Typically, component libraries are statically linked into your application, which means that the compiler compiles it into the SWF file before the user downloads that file.
To build a component library SWC file, you use the include-classes, include-namespaces, and include-sources component compiler options. For more information on building component libraries, see Using compc, the component compiler.
You can use shared assets that can be separately downloaded and cached on the client in Flex. These shared assets are loaded by multiple applications at run time, but must be transferred only once to the client. These shared files are known as Runtime Shared Libraries or RSLs.
RSLs are the only kind of application asset that is dynamically linked into your Flex application. When you compile your application, the RSL source files must be available to the compiler so that it can perform proper link checking. The assets themselves are not included in the application SWF file, but are only referenced at run time.
To create an RSL SWC file, you add files to a library by using the include-classes and include-namespaces component compiler options. To use RSLs when compiling your application, you use the external-library-path, externs, load-externs, and runtime-shared-libraries application compiler options. The external-library-path, externs, and load-externs options provide the compile-time location of the libraries. The runtime-shared-libraries option provides the run-time location of the shared library. The compiler requires this for dynamic linking.
For more information, see Using Runtime Shared Libraries.
A theme defines the look and feel of a Flex application. A theme can define something as simple as the color scheme or common font for an application, or it can be a complete reskinning of all the components used by the application.
Themes usually take the form of a SWC file. However, themes can also be composed of a CSS file and embedded graphical resources, such as symbols from a SWF file.
Theme files must be available to the compiler at compile-time. You build a theme file by using the include-file and include-classes component compiler options to add skin files and style sheets to a SWC file. You then reference the theme SWC file when you compile the main Flex application by using the theme application compiler option.
For more information about themes, see Using Styles and Themes in the Adobe Flex 3 Developer Guide.
You can package libraries of localized properties files and ActionScript classes into a SWC file. The application compiler can then statically use this SWC file as a resource bundle. For more information about creating and using resource bundles, see Localizing Flex Applications in the Adobe Flex 3 Developer Guide.