TweenLite isTweening Method.

I’m on a project right now that’s using TweenLite But it’s missing the isTweening method. Here it is:

First update the constructor:
Line 180/181 should look like this:

_all[$target][this] = this;
_all[$target]['instance'] = this;

In the executeAll() function, there is an innter for loop, change it to this:

for (twp in a[p]) {
 if(twp == 'instance')
  continue;
 tw = a[p][twp];
 if (tw != null && tw.active) {
 tw.render(t);
 }
}

Then add this somewhere at the bottom:

public static function isTweening(target:*):Boolean
{
  if(_all[target] == null)
    return false;
  var t:* = _all[target] as Dictionary;
  var instance:TweenLite = t['instance'] as TweenLite;
  return instance.active;
}

Hope that helps someone out there.

Jack said,

January 29, 2008 @ 08:47

FYI, I started working on a TweenMax class that extends TweenLite and adds capabilities like pause/resume and isTweening. It is in its *VERY* early stages and doesn’t have much other functionality yet, but if you want to download an early alpha version (knowing that functionality may change down the road), you’re welcome to do so here:

AS2: http://www.greensock.com/ActionScript/TweenMax/TweenMax.zip
AS3: http://www.greensock.com/ActionScript/TweenMax/TweenMaxAS3.zip

It’s not meant for mass adoption yet or anything – I’m just making it available to folks that really need some of those extra features sooner rather than later.

RSS feed for comments on this post · TrackBack URI

Leave a Comment