1 Reply Latest reply on Jun 13, 2011 10:08 AM by Darrell Loverin

    Flex 4.5 Using RSLs with modules and sub-applications

    FM_Flame Level 1

      Using RSLs with modules and sub-applications

      RSLs are designed to work efficiently with modules and sub-applications. When using RSLs with modules and sub-applications, note that:
      • Main applications only load RSLs that are needed, but create placeholders for the remaining framework RSLs. This lets the module or sub-application load other framework RSLs into the main application when they need it.

      • Sub-applications and modules share framework RSLs by default.

      • Sub-applications and modules can share custom RSLs if you configure the application domain that the RSLs are loaded into.

      Using placeholder RSLs

      When you compile an application with Flex, the default behavior is to compile the application against the framework (or default) RSLs. When the application runs, it loads only the framework RSLs that it actually uses, and creates placeholders for the remaining framework RSLs. When the application loads a module or sub-application that requires one of the framework RSLs for which there is a placeholder, the module or sub-application then loads that RSL into the main application.

      If a module or sub-application requires a framework RSL that is already loaded, it will not load the RSL again. It will instead use the existing RSL.

      To ensure that placeholders for framework RSLs are used, set the remove-unused-rsls compiler argument is true when compiling the main application, sub-applications, and modules. This is the default.

      By default, framework RSLs are loaded into the top-most application domain that contains a placeholder for that RSL. As a result, modules or sub-applications can share RSLs that were loaded by other modules or sub-applications, as long as you do not restrict the domain into which the RSL was loaded.



      Could some one tell me if I understand correctly:

      Having this scenario:

      I have a RSL with a custom component. I use that custom component only in a module of my application. The result will be that the application will not load the RSL and will load it only when the module is loaded but before the module.


      If that is correct I have one more question:

      The main application can track the module loading progress and display it with a progress bar for example. How do I track the loading progress of the RSLs that are loaded before the module?




      The main application tracks the module loading progress and when the module finishes loading I need to use a preloader class like for the main application for the module to track the loading of the rsls ?