From 0be6ba99dad7b3f21217a0165c6cc919739d7a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Petre=CC=81re?= Date: Wed, 1 Nov 2017 08:05:07 -0200 Subject: [PATCH] Variable cc.Animate._currFrameIndex was being set as global --- cocos2d/actions/CCActionInterval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js index 7534d17fca..11b18bf9b1 100644 --- a/cocos2d/actions/CCActionInterval.js +++ b/cocos2d/actions/CCActionInterval.js @@ -3393,8 +3393,8 @@ cc.Animate = cc.ActionInterval.extend(/** @lends cc.Animate# */{ var numberOfFrames = frames.length, locSplitTimes = this._splitTimes; for (var i = this._nextFrame; i < numberOfFrames; i++) { if (locSplitTimes[i] <= dt) { - _currFrameIndex = i; - this.target.setSpriteFrame(frames[_currFrameIndex].getSpriteFrame()); + this._currFrameIndex = i; + this.target.setSpriteFrame(frames[this._currFrameIndex].getSpriteFrame()); this._nextFrame = i + 1; } else { // Issue 1438. Could be more than one frame per tick, due to low frame rate or frame delta < 1/FPS