Table of contents
As I have played with RSLs more I saw something surprising: If I compile the swc into a swf the resulting swf is bigger (almost twice) as it should have been. When you use compc to create a SWC, the SWF inside the SWC contains a lot of unnecessary stuff when used as an RSL. That stuff is necessary to create an application which uses the SWC, so don’t go ditching compc. Here is what you need to do if you want to have size optimized RSLs:
- Create an actionscript class that extends sprite and include in it references to the stuff you want to go in the RSL:
package { import flash.display.Sprite; import mx.core.Application; public class smallLinker extends Sprite { private var application:Application; } }
- Compile the swc
compc -debug=false -o=my.swc smallLinker - Compile your RSL:
mxmlc -o=my.swf -file-specs=smallLinker.as - Compile your application:
mxmlc -external-library-path+=my.swc \
-runtime-shared-libraries=http://www.yourhost.com/my.swf \
-o=app.swf -file-specs=app.mxml - Upload app.swf and my.swf to your host.
- Run your application and verify it works.
Popularity: 53%
Tags: ActionScript, bug, flex, RSL, tutorial
This post was written by Virgil Cristea
Views: 1466



















Thanks for the tip.