Jump to content
Search Community

Problem: AS2 tweenlite: _y and _x not working, but _alpha is

dirty30 test
Moderator Tag

Recommended Posts

What am I doing wrong. AS2

 

The mc wont move, but it does change alpha.

 

import com.greensock.*;
import com.greensock.easing.*;

my_mc_big._alpha = 0;
my_mc_big._y = 400;
TweenLite.to(my_mc_big, 1, {_x:200, ease:Expo.easeOut, delay:0});
TweenLite.to(my_mc_big, 1, {_y:0, ease:Expo.easeOut, delay:0});
TweenLite.to(my_mc_big, .35, {_alpha:100, ease:Linear.easeNone, delay:0});

 

If you see a problem, let me know...!

Link to comment
Share on other sites

Your last tween is overwriting the first 2 because the default overwrite mode in TweenLite is ALL_IMMEDIATE. See http://www.greensock.com/overwritemanager/ for more info. It's easy to fix. I'd recommend just using OverwriteManager's AUTO mode. You can turn it on like this:

 

OverwriteManager.init(OverwriteManager.AUTO);

 

Also, there's no reason to define the delay as 0 because that's the default. And you can tween multiple properties with one tween - I noticed your _x and _y tweens were separated even though they had the same duration, ease, and start time. So you could combine them to simply:

 

TweenLite.to(my_mc_big, 1, {_x:200, _y:0, ease:Expo.easeOut});

Link to comment
Share on other sites

This was the ticket. :-)

 

Let me bother you to ask another question, how do I:

 

Add a kind of tween, with nothing happening, to add time.

In the past I used "this" with a "time" parameter.

Followed by and onComplete(nextframe)

 

Can you post a sample of this, basically a non-mc oriented time delay going to the next frame?

 

 

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.
×
×
  • Create New...