1 Reply Latest reply on Jun 22, 2010 8:17 AM by Darrell Loverin

    Missing READY Event by using ModuleManager!

    romopat

      Hello,

       

      i have some problems by using mx.modules.ModuleManager.getModule().

      In 3 of about 100 test, the READY and ERROR event is not dispatch. So I can not even react on it

       

      I use the current SDK Version: 4.1.0.16076

       

      Is this a bug or am I doing something wrong?

       

      public static function loadModule(url:String,callback:Function):void {

       

          trace('[MOD] Loading: ' + url)

          var info:IModuleInfo = mx.modules.ModuleManager.getModule(url);

          info.addEventListener(ModuleEvent.READY,function():void{

              trace('[MOD] Finished: ' + url);

              callback(info.factory.create());

          });

       

       

          info.addEventListener(ModuleEvent.ERROR,function(event:ModuleEvent):void{

              trace('[MOD] Error: ' + event.toString());

          });

       

          info.addEventListener(ModuleEvent.PROGRESS,function(event:ProgressEvent):void {

              trace('[MOD] Progress:',event.bytesLoaded, event.bytesTotal);

          });

       

          info.load();

      }

        • 1. Re: Missing READY Event by using ModuleManager!
          Darrell Loverin Level 4

          It is possible that this may be a bug. Are you loading multiple modules at the same time? Just loading the same module 100 times?

          When you fail to get a READY or ERROR event do you get any PROGRESS events?

          When you fail to get a READY or ERROR event try getting the module again (ModuleManager.getModule(url)) and check the values of "data", "error", "factory", "loaded", "ready", and "setup".

           

          The factory property, if available, should be of type FlexModuleFactory. If you see this field in the debugger then check to see what the value of its private "state" variable is.

           

           

          -Darrell