Specifications
CHAPTER 10
212
If you are using a cross-domain RSL, you can also specify the location of the crossdomain.xml file, and the location
of one or more RSLs to be used as a failover RSL. The following example specifies a full URL for the location of
the RSL, and the locations of a crossdomain.xml file and failover RSL on the command line:
mxmlc -runtime-shared-library-path=
../lib/mylib.swc,
http://www.my-domain.com/rsls/library.swf,
http://www.my-domain.com/rsls/crossdomain.xml,
http://www.my-other-domain.com/rsls/library.swf,
http://www.my-other-domain.com/rsls/crossdomain.xml
Main.mxml
In the configuration file, this would be represented as follows:
<runtime-shared-library-path>
<path-element>../lib/mylib.swc</path-element>
<rsl-url>http://www.my-domain.com/rsls/library.swf</rsl-url>
<policy-file-url>http://www.my-domain.com/rsls/crossdomain.xml</rsl-url>
<rsl-url>http://www.my-other-domain.com/rsls/library.swf</rsl-url>
<policy-file-url>http://www.my-other-domain.com/rsls/crossdomain.xml</rsl-url>
</runtime-shared-library-path>
Toggling RSLs on the command line
When compiling an application that uses RSLs, the command-line compiler options can be unwieldy and difficult
to read. It is generally easier to define RSLs in your configuration files. However, when you do that, it is not very
easy to enable or disable them as you develop your application because you have to edit the configuration file any
time you want to change the way the RSLs are compiled.
To disable the use of RSLs without editing the configuration file, set the value of
static-link-runtime-
shared-libraries
to false. By doing this, you can toggle the use of RSLs from the command line without
having to edit the configuration file or enter long sets of command-line options. The default value of this option
is
true.
While you typically set the value of the
static-link-runtime-shared-libraries option on the command
line, you can also set it in the configuration file. If you set any RSL values on the command line, then the value of
the
static-link-runtime-shared-libraries option in the configuration file is ignored.
Optimizing RSL SWF files
The default SWF file in your SWC files includes debugging code and metadata that increase the file size. The
debugging code is necessary for the compiler to run, but is not necessary at run time unless you want to debug the
RSL. You can remove the debug code and unnecessary metadata by using the optimizer tool.










