1 Reply Latest reply on Jul 28, 2010 8:20 AM by artguate

    Loading RSLs from Modules

    artguate

      I posted this question in the open source forum, but it doesn't get as much traffic, so I'm moving the question here.

       

      For a while I've been wanting to be able to load an RSL from a  Module.  The reason for this is that some modules require some RSL but  that RSL is not needed in the MainApp.

      I've googled alot on  this subject and can't find any information that will show that this is  possible, but now reading up on the enhancements of the Hero Sdk (http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements) it seems to be possible.

       

      To be specific here is a quote from the info

      3.    Going into Flex 4 we only expected sub-applications and modules to   re-use the RSLs loaded by the main application. But now we see modules   that are being used to load custom RSLs. Expecting the main application   to load all of the RSLs won't work anymore. We are also seeing cases   where modules want to be independent of the application and load all  the  RSLs it needs without regard for which RSLs the application is  loading.  Today this can result in multiple loads of the same RSL.

       

       

      It is my understanding that RSL must be loaded by a Flex app at  startup.  But I don't wish to load ALL the RSLs at startup.  Although  the docs say you can't load them after startup, from the post mentioned  above ((http://opensource.adobe.com/wiki/display/flexsdk/RSL+Enhancements) ) I deduce that it can be done, and I wish to figure out the how.  It  indicates that this will be a feature of 4.5 but it hints that it can be  done now, although not in an obvious way.

       

      Let me give an example:

      Let's say I have a library that has methods that are used by different modules.

      So  basically I would create an RSL that holds those methods and load it at  startup so they are available when ever any of the modules need them.

       

      But what if the user doesnt' use doesn't invoke any of the Modules that use that RSL?

       

      I loaded the RSL for nothing.  Loading isn't the really bad part, downloading it is.

       

      So  what I want is to load the RSL only  when one of the modules that needs  it  is loaded.  Regardless if it's an AIR app or a Web App.

       

      Thanks