1 Reply Latest reply on Jul 27, 2009 4:50 PM by Flex harUI

    module loading fine,but UI is not being displayed

    kerna1 Level 1

      i am loading a module within my application. following is the code i am using:

       

            moduleInfo = ModuleManager.getModule("myModule.swf");
            moduleInfo.addEventListener(
               ModuleEvent.READY, function( event : ModuleEvent ):void {

       

                  myModule = event.module.factory.create();
                  myModule.initApp();
              });

       

            moduleInfo.load();

       

      the initApp() function is being called properly. however, the mxml tags in the myModule.mxml file which correspond to the UI are not being loaded and shown on the window. in debugging mode, I am checking the properties of the loaded module and see the following after the module has been loaded:

       

      $height    0   
      $numChildren    0   
      $parent    null   
      $visible    false   
      $width    0   
      $x    0   
      $y    0  


      myModule.mxml looks like this :

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()">
         <mx:Script>
         <![CDATA[

       

            public function initApp():void {

       

                trace("hit");
            }

       

         ]]>
         </mx:Script>

       

         <mx:Panel title="test" width="283" x="0" y="0" visible="true">
          <mx:VBox>
              <mx:ComboBox id="mode" x="20" y="20" width="100">
                  <mx:dataProvider>
                      <mx:Array>
                          <mx:String>x</mx:String>
                          <mx:String>y</mx:String>
                          <mx:String>z</mx:String>
                      </mx:Array>
                  </mx:dataProvider>
              </mx:ComboBox>
              <mx:HBox>
                  <mx:Button label="a"/>
                  <mx:Button label="b"/>
                  <mx:Button label="c"/>
                  <mx:Button label="d"/>
              </mx:HBox>
          </mx:VBox>
         </mx:Panel>
      </mx:Module>

       

      any idea why this could be happening? the module is loaded properly, the READY event is fired, the initApp() function is being called. however, the Panel and its components are not being registered and displayed. i am loading other modules and they are displaying fine... it is just this module that is giving trouble.

       

      thanks in advance.