From 9d8d509fc714968801501d44154a3d3f5ff8badc Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Wed, 31 Oct 2007 22:23:15 +0000 Subject: [PATCH] Let the world know what's playing. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@323 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/AlphaFade.as | 1 - src/as/com/threerings/flash/AnimationImpl.as | 5 +++++ src/as/com/threerings/flash/AnimationManager.as | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/flash/AlphaFade.as b/src/as/com/threerings/flash/AlphaFade.as index befde748..1f08de6b 100644 --- a/src/as/com/threerings/flash/AlphaFade.as +++ b/src/as/com/threerings/flash/AlphaFade.as @@ -63,6 +63,5 @@ public class AlphaFade extends AnimationImpl protected var _to :Number; protected var _duration :Number; protected var _done :Function; - } } diff --git a/src/as/com/threerings/flash/AnimationImpl.as b/src/as/com/threerings/flash/AnimationImpl.as index 9d1934f6..19994daa 100644 --- a/src/as/com/threerings/flash/AnimationImpl.as +++ b/src/as/com/threerings/flash/AnimationImpl.as @@ -33,6 +33,11 @@ public class AnimationImpl implements Animation AnimationManager.stop(this); } + public function isPlaying () :Boolean + { + return AnimationManager.isPlaying(this); + } + public function updateAnimation (elapsed :Number) :void { // please implement! diff --git a/src/as/com/threerings/flash/AnimationManager.as b/src/as/com/threerings/flash/AnimationManager.as index 9dfbd31e..e8a80bfc 100644 --- a/src/as/com/threerings/flash/AnimationManager.as +++ b/src/as/com/threerings/flash/AnimationManager.as @@ -82,6 +82,14 @@ public class AnimationManager } } + /** + * Test to see if the specified animation has been started and not stopped. + */ + public static function isPlaying (anim :Animation) :Boolean + { + return _anims.indexOf(anim) >= 0; + } + /** * Track a DisplayObject that is also an Animation- it will * automatically be started when added to the stage and