Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
<?xml version="1.0" encoding="utf-8"?><fab:FabricationApplication xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:fab="org.puremvc.as3.multicore.utilities.Fabrication.components.*"> <mx:Script> <![CDATA[ import myapp.controller.MyAppStartupCommand; override protected function getStartupCommand():Class { return MyAppStartupCommand; } ]]> </mx:Script> </fab:FabricationApplication>
<?xml version="1.0" encoding="utf-8"?><fab:FabricationModule xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:fab="org.puremvc.as3.multicore.utilities.Fabrication.components.*"> <mx:Script> <![CDATA[ import mymodule.controller.MyModuleStartupCommand; override protected function getStartupCommand():Class { return MyModuleStartupCommand; } ]]> </mx:Script></fab:FabricationModule>
var moduleLoader:FabricationModuleLoader = new FabricationModuleLoader();moduleLoader.url = moduleDescriptor.url;moduleLoader.router = applicationRouter;moduleLoader.setDefaultRoute(applicationModuleAddress.getInputName());moduleLoader.addEventListener(FabricationModuleEvent.MODULE_INITIALIZED, moduleInitializedListener);moduleLoader.loadModule();
// to listen to a routed notification from the shell, in the module's mediators use,override public function listNotificationInterests():Array { return ["MESSAGE_FROM_SHELL"];}// and handle the notification as you would in PureMVCoverride public function handleNotification(note:INotification):void { if (note.getName() == "MESSAGE_FROM_SHELL") { }}// to send a notification to the shell use,override public function onClick():Array { routeNotification("MESSAGE_FROM_MODULE", {foo:"bar"});}
// to send a message to all modules, use *routeNotification(noteName, noteBody, noteType, "*");// to send a message to all instances of a specific module use, ModuleName/*routeNotification(noteName, noteBody, noteType, "ModuleName/*");// to send a message to a specific module userouteNotification(noteName, noteBody, noteType, "ModuleName/ModuleInstanceID");
I want to thank Cliff Hall for creating PureMVC. It has made my Flex programming much more fun.
public function acceptRouter(router:IRouter):void { bootstrapper.acceptRouter(router);}public function getModuleAddress():IModuleAddress { bootstrapper.getModuleAddress();}