0 Replies Latest reply on Jan 3, 2011 12:49 PM by FM_Flame

    Flex 4 preloading modules and moduleFactory question?




      I've run some tests and taking into consideration this info about preloading modules: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64277-7ffd.html#WS2d b454920e96a9e51e63e3d11c0bf64277-7feb


      Here are 2 scenarios:

      1) If you preload a module like the link example above, then you can't load it with moduleFactory any more, since it was preloaded without one. So there will be no styles inherited at all.


      2) If you preload a module like the link example above, but this time you pass moduleFactory, then it will be preloaded with the moduleFactory and when you load it into your application the styles will be inherited, no matter if you pass or not the moduleFactory here. It only depends on the moduleFactory u pass when you preload it.


      Now here is the summary question which I think is not possible at this point but just want to make sure if there isn't a way and maybe request a feature for it:

      Is it possible to have 1 module loaded 2 times in an application with 2 different moduleFactories passed to each ?

      Example: If for the first you pass moduleFactory = null, and for the second you pass the main app moduleFactory



      I think it doesn't matter if we talk about preloading or loading the same module more than once at the same time


      I'm pretty sure that the first time it is loaded it will get the moduleFactory and the second time it will use the moduleFactory specified the first time, not the one which is specified when loading.

      So if we take this example we pass null for the first time the module is loaded, which means the second time it's loaded no matter we pass the main app moduleFactory, it will still be null and no styles will be inherited.


      I'm not sure but I think that if you trace the moduleFactory it will correctly display the object you passed so in our example in the second loading, moduleFactory won't be null but the main app moduleFactory, but styles won't be inherited anyway..