the Sprite afterFrame function should only execute once

This commit is contained in:
Eric Rowell 2012-08-26 00:24:38 -07:00
parent f08701e347
commit 5e6c8774e8
3 changed files with 5 additions and 1 deletions

View File

@ -5391,6 +5391,8 @@ Kinetic.Sprite.prototype = {
that._updateIndex();
if(that.afterFrameFunc && index === that.afterFrameIndex) {
that.afterFrameFunc();
delete that.afterFrameFunc;
delete that.afterFrameIndex;
}
}, 1000 / this.attrs.frameRate);

File diff suppressed because one or more lines are too long

View File

@ -70,6 +70,8 @@ Kinetic.Sprite.prototype = {
that._updateIndex();
if(that.afterFrameFunc && index === that.afterFrameIndex) {
that.afterFrameFunc();
delete that.afterFrameFunc;
delete that.afterFrameIndex;
}
}, 1000 / this.attrs.frameRate);