0 Replies Latest reply on Apr 12, 2010 8:57 AM by Cường Trần

    Flex Module

    Cường Trần

      Hi everybody,

      When create flex application, i usually create modules. Here is example that i handle when module is load:

      var module:Module =  evt.currentTarget as IFlexModuleFactory).create() as Module

       

      I don't know the exactly workflow of flex module so i digg flex code and language reference and find that:

      IFlexModule: "The IFlexModule interface is used as an optional contract with IFlexModuleFactory.  When an IFlexModule instance is created with the  IFlexModuleFactory, the factory  stores a reference to itself after creation."

       

      And here is the code:

      package mx.core {

       

      /**
      *  The IFlexModule interface is used as an optional contract with IFlexModuleFactory.
      *  When an IFlexModule instance is created with the IFlexModuleFactory, the factory
      *  stores a reference to itself after creation.

      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
      public interface IFlexModule
      {
          /**
           *  @private
           */
          function set moduleFactory(factory:IFlexModuleFactory):void;

       

          /**
           * @private
           */
          function get moduleFactory():IFlexModuleFactory;

       

      }

       

      }

       

      The question is that when instance of IFlexModule and FlexModuleFactory are created?  The ModuleLoader and ModuleManager class do not create  them.

       

      Thanks