Flex, ActionScript and Related Stuffs

Enjoy!!!!

Archive for May, 2008

Implementing the Flash Player Cache feature

Posted by flexrays on May 7, 2008

In this article I will be telling you how to creating a dynamically linked application i.e how to implement Flash Player cache feature by using RSLs with Flex Builder

But let us first know what is a statically linked application and a dynamically linked application

Statically linked application – Flex framework code and the application code will make the SWF file increasing the size of the SWF file

Dynamically linked application – Flex framework code will be added dynamically to the SWF code thus reducing its size
If you want to check the result of the above mentioned feature live the follow the steps

1. Create any flex application with some code

2. Get the true size of the application – Follow the steps
1. By default, Flex Builder adds debugging information to SWF files, so in order to see the true size of the application,
turn off the debugging information
2. To do this, add -debug=false to the Additional Compiler Arguments section of the Flex Compiler Properties dialog box

3. Check the size of the application by viewing the properties of the application’s SWF file created in the bin directory
Note down the size

4. Now go to Project Properties (right click on Flex project and select properties), then choose the Flex Build Path properties
and click the Library Path tab

5. In the Framework Linkage pop-up menu, change the link type from “Merged into code” to “Runtime shared library (RSL).”
Click OK to save the changes.

6. Build the project

7. Now check the file size of the SWF file. You will definitely be surprised!!!!

266268  bytes – BEFORE
- 125020  bytes – AFTER
——
141248  bytes – DIFFERENCE IN SIZE

Important things

When you choose the option to use RSLs, all of the debug information is removed.
So you can easily switch between a statically linked application and a dynamically linked application just by toggling the option in the Framework Linkage pop-up menu from “Merged into code” to “Runtime shared library (RSL).”

The framework RSL is the only RSL that is configured by default in the flex-config.xml file because every Flex application uses over 100K of framework classes. If you do add RSLs, the compiler will always load any RSLs you specify whether or not they are used by your application.

For more information on this check the following link
http://www.adobe.com/devnet/flex/articles/flash_player_cache_print.html

Posted in Flex | Leave a Comment »

Have you heard of Flash Player cache?

Posted by flexrays on May 7, 2008

I was reading an article from Adobe about How to increase the performance of the Flex application using the new Flash Player cache feature available in new Adobe Flash Player 9 Update 3 (9,0,115,0)

1. The Flash Player cache is a new feature available in Flash Player 9 Update 3 (9,0,115,0).
2. The cache allows files signed by Adobe to be cached by Flash Player.
3. These files end in the file extension .swz.
4. They can be reused in more than one domain, apart from the domain in which they originated
5. The SWZ file persists in the cache even after the browser is closed, provided that the end user does not change settings in
the Flash Player Settings Manager to reduce their caching ability
6. A SWZ downloaded in IE can also be used in Mozilla Firefox as it requires only one copy of the framework
7. In Flex 3 , the framework library code has been rolled into RSLs (Runtime shared library)
RSL can either be an SWZ or SWF, which can be loaded runtime instead of being statically linked into the application
Because of this, the application’s file size becomes smaller.
8. Once the Flex-signed RSLs are cached on a user’s machine from running one application, they are available for use by all other
applications, regardless of the original domain used to load the application.

Posted in Flex | 1 Comment »

Things to take care of while building Flex Web Applications

Posted by flexrays on May 7, 2008

Four  important points to take care of while building Flex Web Applications

1. Avoid use of too many containers in the flex application
Flash Player uses a hieratical display object graph. The deeper containers are nested the longer the rendering takes by hindering the performance of your application. As per Adobe it is 100 percent avoidable.
2. Avoid use of very long animations
Most animations are simply TOO LONG and they will annoy users. Developers should make sure that the animations have meaning and provide context.
3. Avoid use of complicated itemRenderers in List, Datagrid
As mentioned in the first point, ItemRenderer is one of the place where containers can get deeply nested. The number of item renderers which are rendered by the DataGrid is the number of visible rows times the number of visible columns. This slows down the applications. When complex layout logic is needed in an item renderer, it is best to use UIComponent (or other more low-level classes) and position the contents for that cell manually.

4. Make use of Runtime Shared Libraries (RSL)
Runtime Shared Libraries (RSL) is available for reducing the size of your applications.

Posted in Flex | Leave a Comment »