From 353d7213d0791be15ef0a60f1e7a9702da3ed04c Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 27 Apr 2007 23:06:32 +0000 Subject: [PATCH] Bugfix for animations that complete instantly. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@216 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/AnimationManager.as | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/flash/AnimationManager.as b/src/as/com/threerings/flash/AnimationManager.as index 3efe2088..50ac200c 100644 --- a/src/as/com/threerings/flash/AnimationManager.as +++ b/src/as/com/threerings/flash/AnimationManager.as @@ -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; }