OK, so I built a project to test the issue. I didn't include pipes, but just bubbled an event on the display to keep the code as simple as possible.
The only addition to the code is the KapIt console for monitoring the framework. Shift+alt+Click will open the console.
To my suprise, initially, everything worked just fine. However, it wasn't until I started messing with the static Facade.hasCore() that I saw the UIComponent error again. With a little experimentation, I was able to find what conditions would cause the error using the method and which would work as expected.
What I found was if I test for the module core existence from the shell (calling Facade.hasCore(MyModule.NAME) on Shell.mxml line 53, the UIComponent class throws the error.
private function loadModule(e:MouseEvent):void
{
if (moduleContainer.numElements == 0)
{
// Testing to see if core exists here causes UIComponent error
trace("Module Core Exists:", Facade.hasCore(MyModule.NAME))
moduleInfo = ModuleManager.getModule("module/MyModule.swf");
moduleInfo.addEventListener(ModuleEvent.READY, moduleReadyHandler);
moduleInfo.load();
}
}
However, if I performed the same hasCore test from within the module on line 27 - trace(Facade.hasCore(NAME)), then no error is thrown:
public static const NAME:String = 'MyModule';
private function init():void
{
// testing to see if the core exists here works fine.
trace(Facade.hasCore(NAME));
ModuleFacade.getInstance(NAME).startup(this);
}
So, here is where my lack of computer sciene knowledge may be my problem:
Since Facade.hasCore() is a static function, then I would personally think it's not scope specific and could be called from anywhere in the application. However, it would appear that I am observing a scope specific behavior in that I can't test for the existence of a module core from the shell.
Could someone clarify what is suppose to happen and is the error on my end from lack of understanding or something else?
I posted the project on my server. It's a zip, but just extract and you will find the .fxp inside and use File->Import to bring it into your workbench.
http://67.239.69.29/Testing/ModuleTest.zipThanks!