Specifications
CHAPTER 6
114
SWC files
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 infor-
mation about SWC files, see “About SWC files” on page 174.
Component libraries
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” on page 161.
Runtime Shared Libraries
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.










