Five main areas to improve our flex application


  1. Implement RSL in your Project – Runtime Shared Libraries:- Its a flex framework library which contains files required during runtime of flex application. The advantage of RSL is that its downloaded once only. RSL simply reduces the file size by Approximately 500kb. Implementing RSL is very easy:

    GOTO Project -> Properties -> Flex Build Path -> Library Path and select “Runtime Shared Library (RSL)” from the “Framework linkage” combobox.
    Press OK and you are done. Now application compiles and creates a framework (swz) file along with swf file looks like framework_3.2.0.3958.swz.

    Now you must copy this file to your webserver along with your swf file from where it can be downloaded.
    One most important thing is that you must have swz file extension added to your webserver. So that it can be accessed uring url. Check that by using your website path to framework if it can be saved to your disk then its fine else get it fixed first from you web administrator.

  2. Create SWC file of your common code:- If you are using some common classes that are used in many of your flex projects or different swf files then Create a Library Project of your commonly used classes. Now to add this library to your projects :
    GO to Project -> Properties -> Flex Build Path -> Library Path and Add folder containing swc file.Now your selected folder path starts appearing in “Build path Libraries”.
    Remember to change the “link Type” to “Runtime Shared Library (RSL)”. This file once downloaded will be used for all your swf files running on that Computer afterwards.
  3. Modules:- Create modules of components that are not required immediately or are optional for the application. And you can load them after some delay or later when required. This way you can reduce the file size and improve application performance.
    To create modules:

    • Create new module by going to File -> New -> MXML Module.
    • Add your code to the module file.
    • Add a ModuleLoader component into your main mxml where you want the component to appear and set the url property.
  4. Loading external content:- Do not embed content thats not required immediately to be shown as application initializes. For example if u want to show a window containing thumbnails on user click , do embed or load them on application initialize .just load them when user clicks to show that window .This way you will reduce size and improve performance of application.
  5. Optimize Flex design:- Avoid skining of compoents as far as possible because it add’s to the size of your application. And if you want skining of components then use vector designs for that . Images are bigger in size , difficult to render and distort on scaling so they should be avoided . Components can be given many effects and colors using style manager class. For more info on setting color themes and changing effects check : Dynamic Style Sheet – theme flex.
Advertisements

~ by mjcprasad2000 on May 4, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: