Specifications
23ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
You can also create SWC files that you package and reuse among multiple applications. You typically use static
linking with SWC files, which means the compiler includes all components, classes, and their dependencies in the
application SWF file when you compile the application. For more information on static linking, see “A b o u t
linking” on page 196.
By default, the Flex compiler includes all SWC files in the frameworks/libs directory when it compiles your appli-
cation. For your custom SWC files, you use the
library-path option of the mxmlc compiler, or set the library
path in Flex Builder, to specify the location of the SWC file.
Using an RSL in a Flex SDK application
One way to reduce the size of your application’s SWF file is by externalizing shared assets into stand-alone files
that can be separately downloaded and cached on the client. These shared assets are loaded by any number of
applications at run time, but must be transferred to the client only once. These shared files are known as Runtime
Shared Libraries or RSLs.
An RSL is a stand-alone file that the client downloads separately from your application’s SWF file, and caches on
the client computer for use with multiple application SWF files. Using an RSL reduces the resulting file size for
your applications. The benefits increase as the number of applications that use the RSL increases. If you only have
one application, putting components into RSLs does not reduce the aggregate download size, and might increase
it.
You create an RSL as a SWC file that you package and reuse among multiple applications. To reference an RSL,
you use the
runtime-shared-libraries option for the command-line compiler, or Flex Builder. You typically
use dynamic linking with RSLs, which means that the classes in the RSL are left in an external file that is loaded
at run time.
Every Flex application uses some aspects of the Flex framework, which is a relatively large set of ActionScript
classes that define the infrastructure of a Flex application. If a client loads two different Flex applications, the
application will likely load overlapping class definitions. To further reduce the SWF file size, you can use
framework RSLs. Framework RSLs let you externalize the framework libraries and can be used with any Flex appli-
cation.
For more information on RSLs, framework RSLs, and dynamic linking, see “Using Runtime Shared Libraries” on
page 195.
Using modules in a Flex SDK application
Modules are SWF files that can be loaded and unloaded by an application. They cannot be run independently of
an application, but any number of applications can share the modules.










