Specifications
CHAPTER 10
224
With the mxmlc command-line compiler, use the following command to compile the application:
cd project
mxmlc -static-link-runtime-shared-libraries=true bin/SimpleApp.mxml
Examine the output size of the SWF file. Even though the application contains only a Button control, the size of
the SWF file should be around 140KB. That is because it not only includes component and application framework
classes, but it also includes all classes that those classes inherit from plus other framework dependencies. For
visual controls such as a Button, the list of dependencies can be lengthy. If you added several more controls to the
application, you will notice that the application does not get much larger. That is because there is a great deal of
overlap among all the visual controls.
Run the application in a browser either from the file system or from a server. You can also run the application in
the standalone player.
Next, compile the application again, but this time add the signed framework RSL as an RSL and the unsigned
framework RSL as a failover RSL. For example:
mxmlc -runtime-shared-library-path=c:/p4/flex/flex/sdk/frameworks/libs/framework.swc,
framework_3.0.183453.swz,,framework_3.0.183453.swf rsls/SimpleApp.mxml
The result is a SWF file that should be significantly smaller than the previous SWF file.
This command includes a blank entry for the policy file URL. In this example, the crossdomain.xml file is not
needed because you will deploy the RSLs and the application to the same domain, into the same directory.
In addition, the
runtime-shared-library-path option includes an unsigned failover RSL as its final parameter.
This is a standard framework RSL SWF file that is provided to support older versions of Flash Player that do not
support signed RSLs. It is not cross domain, and if used by the client, it is stored in the browser’s cache, not the
framework cache.
You must now deploy the application and the framework RSLs to a server. You cannot request the SimpleApp.swf
file from the file system because it loads network resources (the framework RSLs) and this will cause a security
sandbox violation unless it is loaded from a server. You deploy the SimpleApp.swf, framework_3.0.183453.swz,
and framework_3.0.183453.swf files to the same directory on your web server.
Request the application in the browser or create a wrapper for the application and request that file.
To verify that the signed framework RSL was loaded by your Flex application, you can look for an SWZ file in your
framework cache. For more information, see “About the Player cache” on page 218.
After the client downloads the signed framework RSL, they will not have to download that RSL again for any Flex
application that uses signed framework RSLs, unless a new version of the framework is released or the RSL’s SWZ
file is purged from the Player cache.










