cocos2d js 如何实现帧动画的监听?

onEnter: function () {
// ////////////////////////////
this._super();

    var mainLayer = ccs.load(res.gallery_anim_json).node;
    galleryAction = ccs.load(res.gallery_anim_json).action;

    mainLayer.x = winSize.width / 2;
    mainLayer.y = winSize.height / 2;


    mainLayer.runAction(galleryAction);
    galleryAction.play("global", false);

//下面这句话没法生效。
galleryAction.setFrameEventCallFunc(this.frameAnimationEvent);

    nodeGrid = new cc.NodeGrid();
    nodeGrid.addChild(mainLayer);
    this.addChild(nodeGrid);

// cc.audioEngine.playMusic(res.background_music, false);
this.scheduleUpdate();
return true;
},
frameAnimationEvent: function(frame) {
cc.log(“frame:” + frame);
},
update: function() {
cc.log(“update”);
}

请问,帧事件的监听只能update方法中实现么? 求大大告知,非常感谢。

你是用 cocosstudio 做的动画吧 你得确定你的制作方式是正确的 我记得是有效的 貌似要勾选记录事件那个选项 然后再添加帧事件 我至少是记得可以触发帧事件的

这个问题,我也有疑问,不知道有没有大神出来指导一下。