Bugfix for animations that complete instantly.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@216 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2007-04-27 23:06:32 +00:00
parent 250670e699
commit 353d7213d0
@@ -32,7 +32,9 @@ public class AnimationManager
// and update it immediately
anim.updateAnimation(0);
if (!_framer) {
// we re-check that the anims are non-empty because the first animation
// to be added could be removed as a result of calling updateAnimation() on it.
if (!_framer && _anims.length > 0) {
_framer = new Sprite();
_framer.addEventListener(Event.ENTER_FRAME, frameHandler);
}
@@ -53,7 +55,7 @@ public class AnimationManager
_anims.splice(dex, 2);
// See if we should clean up a bit
if (_anims.length == 0) {
if (_anims.length == 0 && _framer) {
_framer.removeEventListener(Event.ENTER_FRAME, frameHandler);
_framer = null;
}