dispatchCustomEvent自定义事件触发不了

onLoad: function () {
cc.eventManager.addCustomListener(“Paper”, function(){
cc.log(“1111112”);
});
cc.eventManager.dispatchCustomEvent(“Paper”);
}

参考

http://forum.cocos.com/t/creator-v1-4-eventmanager-pausetarget/44021

把你的事件监听和派送放start里试试看?

好的感谢…

貌似还是一样. 最新版本的cocos creator

那就问问@panda大大

这里具体遇到的问题我不是很确定,可以发个 demo 给我,但是自定义事件,我们不推荐这样注册派发,请使用 EventTarget 来做这件事情,cc.eventManager 中的 API 是引擎内部使用的,外部调用的功效并不保障。

比如

var PaperEventOwner = new cc.EventTarget();
PaperEventOwner.on("Paper", function () {
    ....
});
PaperEventOwner.emit("Paper");