1 Reply Latest reply on Jun 11, 2011 11:24 PM by Flex harUI

    Modules having sub-modules dont load in the right order

    VeenaChezhian

      Hey,

       

      I have a main application which loads a module. The module has two sub-modules in it. I had the module's creationpolicy set to "all", so that all its sub-modules load at application startup.

      I have a creationComplete handler created for the main module ( which has 2 sub-modules ) which sends a global event to the main application about its creation complete phase. I see that the creationComplete of the main module gets called even before it loaded its sub-modules. This case happens only with my release build. When i run the same code in Flash Builder I can easily get it work right.

       

      Any light in this issue will be of great help.

       

      Here is the code snippet which may be helpful

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Module

      xmlns:parsley="http://www.spicefactory.org/parsley"

      xmlns:mx="http://www.adobe.com/2006/mxml"

      width="100%"

      height="100%"

      creationComplete="module1_creationCompleteHandler(event)"

      creationPolicy="all"

      >

      <mx:Script>

      <![CDATA[

      private function module1_creationCompleteHandler(event:Event):void

      {

      var simEvent:SIMActivityEvent = new SIMActivityEvent(SIMActivityEvent.SIM_ACTIVITY_MODULE_LOAD_COMPLETE);

      simEvent.message = _resourceManager.getString( 'splashScreen.manageModuleLoaded');

       

      dispatchEvent(simEvent);

      }

      </mx:Script>

       

      <mx:ViewStack

      id="viewStack"

      width="100%" height="100%"

      paddingBottom="5" paddingRight="5" paddingLeft="5"

      change="handleViewChanged()"

      creationPolicy="all"

      >

       

      <mx:ModuleLoader

      url="Module1.swf"

      label="{_resourceManager.getString( 'navigation.appliances')}"

      width="100%"

      height="100%"

      creationPolicy="all"

      />

       

      <mx:ModuleLoader

      url="Module2.swf"

      label="{_resourceManager.getString( 'navigation.agents')}"

      width="100%"

      height="100%"

      />

       

      </mx:ViewStack>

       

      </mx:Module>

       

       

      Btw, the module is a separate project and I am using RSL all over the place. I am not sure if this matters.