2 Replies Latest reply on Dec 8, 2008 12:51 AM by xavixxxx

    Module loads another modules ???


      I have a problem and few questions on the module's loading topic.

      In the Adobe Flex help ( Adobe Flex Help --> load and unload Module), it is written that " MXML-based modules can load other modules. Those modules can load other modules, and so on. but I don't manage to do that and I don't find any example of this concept.

      My project is like this.
      I have a component application. Within this component, a ModuleLoader is present and it can load two modules.
      Inside one of the module, I would like to launch others modules thanks to the ModuleManager. But it doesn't work.
      Inside the method which catch the event ModuleEvent.ready, the code moduleInfo.factory.create() as Module returns null, where as the moduleInfo contains good data.

      I would like to find some example of module which can load other modules. Is it really possible to do that ?
      and how do you do to realize complex application on Flex if it is not possible ?

      Thanks in advance for your answers.

        • 1. Re: Module loads another modules ???
          camfieldaj Level 1
          I took the simplest approach I could get to work. In the main application I have a mx:ModuleLoader defined and in the application init function I do apploader('login.swf');

          In login.swf I have a function that basically does

          If (class == "Admin")

          In those modules I load other modules based on user input.

          Hope this helps.
          • 2. Re: Module loads another modules ???
            xavixxxx Level 1
            Thanks for your answer.

            Ok, so you have one moduleLoader in your component application and you load and unload modules with the moduleLoader. I agree with that method, but for me, when you do that, you don't load a module inside another module.(even if the method is called from one module)

            It isn't what I would like to do. I would like to load a module inside another module. It means for example to have a moduleLoader in my application which loads a module called Module1 and to have another moduleLoader in this module which loads another module called Module2.
            When I read the adobe flex help (it's written in the first message), if I have well understand, it could be possible to do that but I don't manage to have something working.

            Do you understand the message in the adobe flex help like me ? Is it possible to do what I would like ?