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.
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 ?
Modules do not have a preloader like an application does. You can track the progress of the module being loaded but not the progress of its RSLs. If you would like to have this feature please create an enhancement request in the JIRA bug database. Thanks.