Search code examples
apache-flexantrsls

Change the default location of Runtime Shared Library files


To make my Ant Generated swf as small as possible, i used the Runtime Shared Library like described in this URL.

By default, the RSL files should be located with the compiled swf (without RSL).

Thus, do you know how can I change the location's property of the SRL files?

Because I have the compiled swf in many directories, that's why we should have only one resource of the RSL as well as in one separated directory


Solution

  • Have a look at an RSL linkage definition:

    <runtime-shared-library-path>
        <path-element>libs/framework.swc</path-element>
        <rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz</rsl-url>
        <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
        <rsl-url>framework_4.6.0.23201.swz</rsl-url>
        <policy-file-url></policy-file-url>
    </runtime-shared-library-path>
    

    The rsl-url nodes define where the application will look for the library. It will first try to get it from the first URL; if that fails it will try the second; and so on until it finds a link that works or fails.
    You can add as many URL's as you like, but for framework RSL's you'll typically have a link to Adobe's repository as the first URL, and one fallback URL on your own server.

    These URL's can be absolute or relative. If for instance you'd want you SDK RSL's to be located in a directory called 'sdk' under the same directory your application is in, just change the secondary rsl-url node to:

    <rsl-url>sdk/framework_4.6.0.23201.swz</rsl-url>
    

    The same principle applies if you wish to do it through compiler arguments. You could do it like this:

    -runtime-shared-library-path=${swc},${swz.primary},http://fpdownload.adobe.com/pub/swz/crossdomain.xml,${swz.secondary}