multitonKey for this Notifier not yet initialized!
官方解释是:
As
noted in the release notes for MultiCore, you cannot access the facade
from within the constructor of a Notifier subclass. The first chance you
get to access the Facade is in initializeNotifier. But you could
instead wait until onRegister. If you wait until onRegister, you don't
have to call super at all.
And
although this represents a slight departure from the Standard version
practices, it actually sheds light on the fact that calling the facade
inside the constructor of a Notifier instance is not really the best
practice anyway. Of course onRegister has only just appeared in 2.0 and
so the fact that it is the more appropriate place for facade access is
just now becoming clear.
Why
is onRegister the better place? Because interaction with the Facade
should only happen when a Mediator or Proxy is registered, and therefore
accessible by other actors via the Facade. For instance a Mediator's
interaction with the Facade could lead to a Notification that the
Mediator needs to hear. But if it is not yet registered, it could not be
notified. Or if a Proxy interacts with the Facade, it could result in
another actor trying to retrieve that Proxy, and if it is not yet
registered, it cannot be retrieved.
Make sense?
也就是说,在所有的订阅者的构造器上,不要访问facade。访问了也白搭。
官方建议在onRegister方法上,来访问facade。
例如:
override public function onRegister():void
{
var avatarPanel:AvatarPanel = new AvatarPanel();
facade.registerMediator(new AvatarMediator(avatarPanel));
controlBarPanel.avatarPanel = avatarPanel;
}
还有
override public function onRegister():void
{
sendNotification(ApplicationFasade.DATALOADED);
}
出现这个问题把send的代码写在onRegister()函数里即可
分享到:
相关推荐
pureMVC_AS3_MultiCore pureMVC多核版本源码
dotnet add package PureMVC.Multicore 演示版 实用工具 平台/技术 状态 生产 执照 适用于C#的PureMVC MultiCore框架-版权所有:copyright:2020 版权所有:copyright:2020 版权所有。 如果满足以下条件,则允许...
puremvc-js-multicore-framework-master
如你下载后的存放的目录是D组:/下载,解压后将创建一个名为PureMVC_AS3_2_0_4的文件夹...注:当然我们也可以把puremvc的的源代码直接复制到我们的项目中使用,那样就无需添加swc了,两者只能存在一个,否则会报错。
PureMVC教程,是学习PureMVC框架的好文章,PureMVC教程,是学习PureMVC框架的好文章,PureMVC教程,是学习PureMVC框架的好文章PureMVC教程,是学习PureMVC框架的好文章,PureMVC教程,是学习PureMVC框架的好文章,PureMVC...
PureMVC_JS_Native_MultiCore
JavaScript MultiCore框架PureMVC是一个轻量级框架,用于基于经典的“设计元模式创建应用程序。 这是的JavaScript端口。 它通过使用 Core actor支持。 此端口包含其他端口中找不到的其他功能-轻量级JavaScript类仿真...
PureMvc ActionScript3 多核版本lib &doc
PureMVC五子棋游戏源码,学习PureMVC
用PureMvc开发Air项目,完整工程实例。 学PureMvc的第一个完整例子
puremvc,极好的flex开源框架,这是一个demo
这是一个使用C#开发语言的基于PureMVC框架的Web登录Demo,是网上绝无仅有的实例。 本文以初学者的视角,详细地介绍PureMVC在ASP.NET的应用。 PureMVC不仅仅是Flex的MVC框架哦,而且它非常的小巧,还等什么呢,快来...
按照puremvc官方网站教程做的登陆实例,在flexBuilder3上运行过.绝对好用. 供大家学习参考.
这个是一个根据AS3(ActionScript 3) pureMVC而转换过来的lua pureMVC。所有的接口完全跟AS3版本一致。 若是想使用,可以直接查看网上的pureMVC 文档,我并未对任何一个函数改名或者更换参数位置。 注意,这个PureMVC...
这是一个MVC例子,简单的接受了MVC的实现过程。
PureMVC学习资料与案例PureMVC学习资料与案例PureMVC学习资料与案例PureMVC学习资料与案例
介绍了PureMVC框架结构以及PureMVC下消息发送机制,有助于更好的了解和学习PureMVC架构
pureMVC项目包 导入的包 pureMVC项目包pureMVC项目包
pureMVC框架 pureMVC源码 学习pureMVC的知识
flex PureMVC框架实例 flex PureMVC框架