Fx{r} is trying to start the Fx{r} Community! Please join our group on Adobe Groups following this link: http://groups.adobe.com/groups/ab29539ab9.
Fx{r} is now on Twitter too. Follow us @ twitter.com/fx_r!
«
»

Flex 2, Flex resources, RIA

RSL further details

Virgil Cristea | 08.01.08 | 1 Comment

Google Buzz

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:

  1. 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;
      }
    }
  2. Compile the swc
    compc -debug=false -o=my.swc smallLinker
  3. Compile your RSL:
    mxmlc -o=my.swf -file-specs=smallLinker.as
  4. 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
  5. Upload app.swf and my.swf to your host.
  6. Run your application and verify it works.
Share and Enjoy:
  • Twitter
  • Google Buzz
  • LinkedIn
  • Google Bookmarks
  • del.icio.us
  • Digg
  • Sphinn
  • blogmarks
  • Reddit
  • StumbleUpon
  • Facebook
  • DZone
  • FriendFeed
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • Slashdot
  • MySpace
  • Add to favorites




Tags: , , , ,

This post was written by Virgil Cristea

Views: 6918

related

1 Comment

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

:

:


«
»