Trying to understand this error:
Error: multitonKey for this Notifier not yet initialized!
at org.puremvc.as3.multicore.patterns.observer::Notifier/get facade()
at app.guildgrid.view::StageMediator()
at app.guildgrid.control.command::ApplicationStartUpCommand/execute()
at org.puremvc.as3.multicore.core::Controller/executeCommand()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()
at org.puremvc.as3.multicore.core::View/notifyObservers()
at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()
at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()
at app.guildgrid::ApplicationFacade/startup()
at Application/creationComplete()
at Application()
ApplicationStartUpCommand override public function execute(notification:INotification):void
{
// Register the stage Proxy
facade.registerProxy( new StageProxy() );
// Register the main application Mediator, stage in this case
facade.registerMediator( new StageMediator( Stage ) );
}
StageProxy public class StageProxy extends Proxy implements IProxy
{
public static const NAME:String = "StageProxy";
/// Constructor
public function StageProxy(proxyName:String=null, data:Object=null)
{
super(NAME, new StageVO() );
}
/// Return data property cast to proper type
public function get stageVO():StageVO
{
return data as StageVO;
}
}
StageMediator...
public static const NAME:String = 'StageMediator';
private var stageProxy:StageProxy; //reference to Proxie
public function StageMediator( viewComponent:Object )
{
// stage viewComponent stored in the inherited (super) viewComponent property
super( NAME, viewComponent );
// Retrieve reference to frequently consulted Proxies
stageProxy = facade.retrieveProxy( StageProxy.NAME ) as StageProxy;
}
EDIT: FIXED
Required
override public function initializeNotifier(key:String):void
{
super.initializeNotifier(key);
stageProxy = facade.retrieveProxy( StageProxy.NAME ) as StageProxy;
}
EDIT 2
A better Fix: (based on Cliff Comments)
override public function onRegister():void
{
// Retrieve reference to frequently consulted Proxies
stageProxy = facade.retrieveProxy( StageProxy.NAME ) as StageProxy;
}
T