seems like I don’t understand onEnter()
function on cc.Sprite
, or it has some problems.
I have a parent sprite -extends cc.Sprite
- , creates cards -they extend cc.Sprite
also- , and every card has his own cc.eventManager.addListener()
in his ctor()
I added onEnter()
function to the parent Sprite - for testing I guess -,
I left it empty…
since then the listeners stopped working , and the runAction()
as well ! , but let’s focus on the Listeners
do you have any idea why onEnter()
is doing this ?
…this is what my sprite may look like
var HelloWorldSprite = cc.Sprite.extend({
winSize: null,
posId:0,
ctor:function(){
this._super();
this.initWithFile(res.HelloWorld_png);
cc.eventManager.addListener(HelloWorldListener.clone(), this);
}
/*
,onEnter:function(){
}
*/
});
uncomment onEnter()
, and the listener is gone !