diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js index f293913dfa..ca1d5f2b12 100644 --- a/cocos2d/actions/CCActionInterval.js +++ b/cocos2d/actions/CCActionInterval.js @@ -340,10 +340,13 @@ cc.Sequence = cc.ActionInterval.extend({ * @return {Boolean} */ initWithTwoActions:function (actionOne, actionTwo) { - if(!actionOne || !actionTwo) + if (!actionOne || !actionTwo) throw new Error("cc.Sequence.initWithTwoActions(): arguments must all be non nil"); - var d = actionOne._duration + actionTwo._duration; + var durationOne = actionOne._duration, durationTwo = actionTwo._duration; + durationOne *= actionOne._repeatMethod ? actionOne._timesForRepeat : 1; + durationTwo *= actionTwo._repeatMethod ? actionTwo._timesForRepeat : 1; + var d = durationOne + durationTwo; this.initWithDuration(d); this._actions[0] = actionOne; @@ -361,6 +364,7 @@ cc.Sequence = cc.ActionInterval.extend({ startWithTarget:function (target) { cc.ActionInterval.prototype.startWithTarget.call(this, target); this._split = this._actions[0]._duration / this._duration; + this._split *= this._actions[0]._repeatMethod ? this._actions[0]._timesForRepeat : 1; this._last = -1; },