ctor:
var load = ccs.load(res.Ani_json);
var mainNode = load.node;
this.addChild(mainNode);
// 对应帧动画的节点,使用seekWidgetByName无效,需要用getChildByName
this._spriteAni = mainNode.getChildByName("spriteAni");
this._spriteAni.setVisible(false);
this._load = load;
load.node.runAction(load.action);
this.scheduleUpdate();
播放动画:
this._spriteAni.setVisible(true);
this._load.action.play("animation0", false); // animation0是创建动画的名称