Table of contents
- How to make your applications smaller and reduce the loading time?
- How to create a swf RSL from a swc and how to use it
- How to reduce the size of any flex app using RSL
- RSL further details
If you ever wanted to make a complex application with Flex you always asked yourself: Is the swf to big? How can I reduce it’s size?
Here are some small tips that do not relate to flex only, and one specific to flex:
- Always use small images (reduce the images size to the exact one you want)
- Use the correct format for files (png/gif/jpg)
- Weight every asset you will want to include in the application
Now let’s take a look at the 4th one that is specific to flex: RSL’s
Imagine in your application you use 2 modules: module A and module B. Both of them need an “Util” class. You have several ways here:
- write the code twice. This is by far the worse approach when the code is big, but when you only have 1-2 functions it might be ok (depending on how much modifications you will do to those functions)
- make another module that will be used in both as “Merge Code”. This is a common approach that is pretty good in terms of code re-use, and almost ok for large common class.
- the RSL method
The following images will show you all the 3 methods and we will go into details of the 3rd one after that.
As you see in this image because the code for the “Util” module was included in both modules used by the application the size of the swf was bigger. But if the application has the 2 modules as swc referenced with “Merged into code”, and each swc has a reference to the same swc (in fact a swf) as RSL then the RSL will only be downloaded once. So the amount of data that the client needs to download is smaller.
How to create an RSL from a swc and how to actually use it in an application will be explained in a later article.
Tags: ActionScript, bug, flex, RSL, tutorial
This post was written by Virgil Cristea
Views: 6691











[...] « How to make your applications smaller and reduce the loading time? [...]
Cool info. thanks!