var coin = new ccs.Armature("goldcoin_drop");
coin.getAnimation().play("coin1");
coin.getAnimation().setMovementEventCallFunc(this.AnimationEventCoinEffect);
var offY = this.Armature.height * this.Armature.getScale() * 0.6;
var rT = GetRandomNum(0.2, 1);
var rY = GetRandomNum(-60, 100);
var r1R = GetRandomNum(-100, 100);
var r1 = GetRandomNum(60 + rY, 160) * Math.abs(r1R)/r1R;
var r3 = GetRandomNum(-10, 10);
coin.x = this.MonsterNode.x;
coin.y = this.MonsterNode.y + offY;
var action = cc.sequence( cc.jumpTo(0.5, cc.p(320 + r1, 270 + rY), 200, 1),
cc.jumpTo(0.3, cc.p(320 + r3 + r1, 270 + rY), r3, 3),
cc.delayTime(rT),
cc.callFunc(BattleLayer_root.PickCoin, BattleLayer_root, coin) );
var scale = ((rY * -1) + 60) / 120 ;
coin.setScale(scale < 0.7 ? 0.7 : scale);
coin.showNum = ArrayMulNumber(showNum, 1/num);
this.Dest.addChild(coin);
coin.runAction(action);
AnimationEventCoinEffect : function (armature, movementType, movementID) {
// cc.log("=========== args =========" + arguments.length)
if (movementType == ccs.MovementEventType.loopComplete) {
if (movementID == "coin1") {
armature.getAnimation().play("coin2");
}
} else if (movementType == ccs.MovementEventType.start) {
if (movementID == "coin3") {
cc.log("armature == " + armature.constructor.name);
var action1 = cc.sequence( cc.moveTo(0.5, cc.p(BattleLayer_root.Panel_Money.x, BattleLayer_root.Panel_Money.y)),
cc.callFunc(BattleLayer_root.onCallback, BattleLayer_root, armature));
armature.runAction(action1);// 这里调用失败:Uncaught TypeError: armature.runAction is not a function。armature.showNum 属性也丢失了
var showNum = new cc.LabelBMFont(GetShowNumFromArray(armature.showNum), res.default_01);
BattleLayer_root.Dest.addChild( showNum );
showNum.x = armature.x;
showNum.y = armature.y;
var action = cc.sequence(
cc.spawn( cc.moveBy(0.8, cc.p(0, 50)),
cc.fadeOut(0.8)),
cc.callFunc(BattleLayer_root.onCallback, BattleLayer_root, showNum));
showNum.runAction(action);
}
}
},
```
注:发布到浏览器执行报错,模拟器不报错
armature.runAction(action1);// 这里调用失败:Uncaught TypeError: armature.runAction is not a function。armature.showNum 属性也丢失了
改了方案,不过还是希望能够解决了这个问题