Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
override public function execute( note:INotification ):void{ var app:Shell = note.getBody() as Shell; facade.registerMediator( new ApplicationMediator( app ) ); facade.registerMediator( new AppAModuleMediator() ); var amm:AppAModuleMediator = facade.retrieveMediator(AppAModuleMediator.NAME) as AppAModuleMediator; app.addAppA(amm.appa); facade.registerMediator( new ShellJunctionMediator() ); sendNotification( ApplicationFacade.MODULES_LOADED, app.appa );}
case ApplicationFacade.MODULES_LOADED: var appam:AppAModule = note.getBody() as AppAModule; connectModule( appam ); junction.sendMessage(PipeAwareModule.APP_TO_MODULE_PIPE,new Message(PipeAwareModule.STDOUT,null,5));break;
public function connectModule( module:AppAModule ):void{ //Create the pipe var moduleToApp:Pipe = new Pipe(); module.acceptOutputPipe(PipeAwareModule.MODULE_TO_APP_PIPE, moduleToApp); //Connect the pipe to our app var appIn:TeeMerge = junction.retrievePipe(PipeAwareModule.MODULE_TO_APP_PIPE) as TeeMerge; appIn.connectInput(moduleToApp); //Create the pipe var appToModule:Pipe = new Pipe(); module.acceptInputPipe(PipeAwareModule.APP_TO_MODULE_PIPE, appToModule); //Connect the pipe to our module var appOut:TeeSplit = junction.retrievePipe(PipeAwareModule.APP_TO_MODULE_PIPE) as TeeSplit; appOut.connect(appToModule); }
override public function onRegister():void{ trace("ShellJunctionMediator::onRegister"); junction.registerPipe( PipeAwareModule.APP_TO_MODULE_PIPE, Junction.OUTPUT, new TeeSplit() ); junction.registerPipe( PipeAwareModule.MODULE_TO_APP_PIPE, Junction.INPUT, new TeeMerge() ); junction.addPipeListener( PipeAwareModule.MODULE_TO_APP_PIPE, this, handlePipeMessage );}
public function connectModule( module:AppAModule ):void{ //Create the pipe var moduleToApp:Pipe = new Pipe(); module.acceptOutputPipe(PipeAwareModule.MODULE_TO_APP_PIPE, moduleToApp); //Connect the pipe to our app var appIn:TeeMerge = junction.retrievePipe(PipeAwareModule.MODULE_TO_APP_PIPE) as TeeMerge; appIn.connectInput(moduleToApp); //Create the pipe var appToModule:Pipe = new Pipe(); module.acceptInputPipe(PipeAwareModule.APP_TO_MODULE_PIPE, appToModule); //Connect the pipe to our module var appOut:IPipeFitting = junction.retrievePipe(PipeAwareModule.APP_TO_MODULE_PIPE) as IPipeFitting; appOut.connect(appToModule); }
case ApplicationFacade.SHELL_SELECTED: if (junction.hasOutputPipe(PipeAwareModule.APP_TO_MODULE_PIPE)) { var myMessage:Message = new Message(PipeAwareModule.STDOUT,new Object(), new Notification(MMEventNames.BASIC_MESSAGE,note.getBody(),"COOL")) junction.sendMessage(PipeAwareModule.APP_TO_MODULE_PIPE, myMessage); }break;
TypeError: Error #1009: Cannot access a property or method of a null object reference. at org.puremvc.as3.multicore.utilities.pipes.plumbing::Pipe/write()[C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pipes_boilerplate\src\org\puremvc\as3\multicore\utilities\pipes\plumbing\Pipe.as:77] at org.puremvc.as3.multicore.utilities.pipes.plumbing::TeeSplit/write()[C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pipes_boilerplate\src\org\puremvc\as3\multicore\utilities\pipes\plumbing\TeeSplit.as:77] at org.puremvc.as3.multicore.utilities.pipes.plumbing::Junction/sendMessage()[C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pipes_boilerplate\src\org\puremvc\as3\multicore\utilities\pipes\plumbing\Junction.as:194] at com.britton.apps.pipesboilerplate.modules.shell.view.mediator::ShellJunctionMediator/handleNotification()[C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pipes_boilerplate\src\com\britton\apps\pipesboilerplate\modules\shell\view\mediator\ShellJunctionMediator.as:75]