Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
With the elimination of the ApplicationFacade, does one register all their commands in the StartupCommand now? So essentially the old ApplicationFacade has moved to the StartupCommand? I haven't tested yet, but I wonder how well the StartupManager utility will play with Fabrication. I think it should be fine.
Just trying to wrap my head around building large apps (many commands) using Flash with Fabrication. I assume only our old "JunctionMediator" mediator extends FlashMediator. The rest of our mediators still extend PMVC's Mediator unless we need the routing of Fabrication?
There is no need for the JunctionMediator at all. The routing of pipe messages happens entirely underneath the system.
Jason,However, If you intend to use Reflexive notification interests, you will need to extend FlashMediator/FlexMediator. Moving forward this is going to the key integration point for new Mediator specific features.
public function loadPlugin(pluginVO:PluginVO) : void { var module:IModuleInfo = ModuleManager.getModule(pluginVO.filename); module.data = pluginVO; module.addEventListener(ModuleEvent.READY, onModuleLoaded, false, 0, true); module.addEventListener(ModuleEvent.ERROR, onModuleFailedLoading, false, 0, true); //add module to the loading queue modules.push(module); //dispatch an event that the module is getting loaded dispatchEvent( new PipeEvent(PipeEvent.PLUGIN_IN_QUEU, pluginVO) ); module.load(ApplicationDomain.currentDomain); } protected function onModuleLoaded(e:ModuleEvent) : void { var module:IModuleInfo = e.module; var pluginVO:PluginVO = module.data as PluginVO; //remove module from loading queue removeModuleFromQueue( module ); //add module to available modulesList components[ pluginVO.title ] = module; pluginVO.loaded = true; } /** * ComponentFactory. * * @param name name of the component which should be instantiated * @return instance of the requested component */ public static function getModule (data:ModuleVO):FlexModule { var module:IModuleInfo = components[ data.type ] as IModuleInfo; var component:FlexModule = module.factory.create() as FlexModule; instance.dispatchEvent( new PluginEvent( component, PluginEvent.CREATED ) ); component.addEventListener(FlexEvent.INITIALIZE, instance.onPluginReady, false, 0, true); return component; }
protected function onPluginCreated (event:PluginEvent) : void { event.plugin.setDefaultRoute( applicationModuleAddress.getInputName() ); } protected function onPluginInitialized (event:PluginEvent) : void { event.plugin.acceptRouter( applicationRouter ); }
Btw, If you are familiar with Flex also check out the link I mentioned[1]. Fabrication 0.4 added Reflexive mediator registration for Flex deferred component instantiation. I am looking for feedback for applying this to Flash projects. Flash components do not seem to have support for deferred instantiation, but I am not very familar with the those components, so i may be wrong. I am thinking more on the lines of something to support the MovieClips hierarchy of Flash.Let's say you have MovieClip assets that are placed on the stage. This may be deep and possibly design driven. And additionally not explicitly given top level instance names. I should be able to mediate components/display objects in this hierarchy in an easy way.I am just thinking out loud here. It would be great if you can share your thoughts on the workflow with flash projects with PureMVC.peace,darshan[1] : http://www.codedrunks.com/index.php/2008/10/17/fabrication-04-released/
// for setting the module's default route to the shellevent.plugin.defaultRoute = "*"; or event.plugin.defaultRouteAddress = applicationAddress;event.plugin.router = applicationRouter;
registerMediator(new FullScreenButtonMediator(resolver(app).re("fullScreenButton.*")));