Hey Jason,
The fabricationCreated event should only really be sent when the application's fabrication has finished initializing completely. That way if the shell/parent needed anything from the child module in the fabricationCreated handler, it has that information. I tried swapping those lines but it breaks the unit tests. Also a couple of flex demo's depend on the module having finished initializing when the fabricationCreated event is received.
Another way to achieve this is to hook into the init sequence of fabrication which is,
- initializeModuleAddress()
- initializeFacade()
- initializeEnvironment()
- startApplication()
The hook method to do what you are looking for is initializeEnvironment. You mentioned you have a ModuleApplication. You need to add a custom fabricator to it. In the ModuleApplication, You need to override initializeFabricator like
override public function initializeFabricator():void {
_fabricator = new ModuleApplicationFabricator(this);
}
And in the ModuleApplicationFabricator < FlashApplicationFabricator do,
override public function initializeEnvironment():void {
super.initializeEnvironment();
facade.registerInterceptor("fooNote", FooInterceptor);
}
peace,
darshan