Jump to content


two tweens at once [SOLVED]

Recommended Posts

Hi all,


I've created a tween:

var ob:Object = new Object();
ob._y = 675;
ob._xscale = ob._yscale = 200;
ob.ease = Linear.easeNone;
var speed:Number = Math.floor(Math.random() * 3) + 4;
TweenLite.to(alien, speed, ob);


The problem is that because it's scaling up at the same time as it's moving down the screen, it seems to "slow" down near the end even with the Linear.easeNone easing. Is there a way to have two concurrent tweens going on an object at different speeds? Meaning can I have the scaling go faster than the moving in y direction tween? Or does anyone have ideas how to compensate for that visual effect?




Link to comment
Share on other sites

Sure, you can have multiple tweens of the same object going at the same time. Did you remember to import the Linear easing class? If not, that's definitely what's causing the slowdown at the end (the default ease is a Quad.easeOut). Make sure you've got import com.greensock.easing.*; at the top.


As far as having two tweens going, I'd recommend using OverwriteManager in AUTO mode for the most convenience (see http://blog.greensock.com/overwritemanager/) but you could just set overwrite:false on your 2nd tween to keep it from overwriting the first one without OverwriteManager.


The other possibility is that as the scale gets larger, the Flash Player is having a harder time rendering the graphics which could make it appear to slow down even though there is no easing happening.


Hope that helps.

Link to comment
Share on other sites

I am importing the linear ease class.


And I had read about the overwriting stuff, but I suppose I read it wrong, I assumed that meant it would just do one after another rather than at the same time... thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.