Jump to content
Search Community

Movie clip not fading back out with TweenLite

Martagnan test
Moderator Tag

Recommended Posts

Hello,

I have some text (in separate mc's) fading in and out, each clip has a different name.

 

I have the following code but the second clip will not fade out before the third clip shows, and then the third clip won't fade either??

 

Can anyone help?

 

Thanks

 

import com.greensock.TweenLite;
import com.greensock.OverwriteManager;
import com.greensock.easing.*;


OverwriteManager.init(OverwriteManager.AUTO);


TweenLite.to(mc_why, 0, {_alpha:0});
TweenLite.to(mc_when, 0, {_alpha:0});
TweenLite.to(mc_briqs, 0, {_alpha:0});

TweenLite.to(mc_why, 3, {_alpha:100});
TweenLite.to(mc_why, 2, {_alpha:0, delay: 2});

TweenLite.to(mc_when, 3, {_alpha:100, delay: 4});
TweenLite.from(mc_when, 2, {_alpha:0, delay: 3});

TweenLite.to(mc_briqs, 3, {_alpha:100, delay: 6});
TweenLite.to(mc_briqs, 2, {_alpha:0, delay: 3});

Link to comment
Share on other sites

the order in which you write your tweens does not effect the order in which they run.

 

for instance:

 

TweenLite.to(mc_when, 3, {_alpha:100, delay: 4});

TweenLite.from(mc_when, 2, {_alpha:0, delay: 3});

 

the _alpha:0 tween will start 1 second before the _alpha:100 tween because the delay is less.

 

make sense?

 

once you get a handle on some of the TweenLite/Max basics please look into TimelineLite which will make building sequences like this a breeze: http://www.greensock.com/timelinelite/

Link to comment
Share on other sites

Brilliant Carl thanks.

 

I went for the TimeLineLite method - very easy!

 

Only problem I have now is how to make the whole 'animation' loop. After it performs the last tween I need a slight delay and then back to the beginning?

 

My code so far...

 

import com.greensock.TimelineLite;
import com.greensock.TweenLite;
import com.greensock.easing.*;


TweenLite.to(mc_heart, 0, {_alpha:0});
TweenLite.to(mc_why, 0, {_alpha:0});
TweenLite.to(mc_when, 0, {_alpha:0});
TweenLite.to(mc_briqs, 0, {_alpha:0});
TweenLite.to(mc_twice, 0, {_alpha:0});
TweenLite.to(mc_stove, 0, {_alpha:0});
TweenLite.to(mc_strip, 0, {_alpha:0});
TweenLite.to(mc_logo, 0, {_alpha:0});


var timeline:TimelineLite = new TimelineLite();
timeline.append(TweenLite.to(mc_why, 2, {delay: 1, _alpha:100}));
timeline.append(TweenLite.to(mc_why, 2, {_alpha:0}));

timeline.append(TweenLite.to(mc_heart, 2, {_alpha:100, _x:157, _y:100, _xscale:72, _yscale:72}), -1.5);

timeline.append(TweenLite.to(mc_when, 2, {_alpha:100}), -0.5);
timeline.append(TweenLite.to(mc_when, 2, {_alpha:0}));

timeline.append(TweenLite.to(mc_briqs, 3, {_alpha:100}));
timeline.append(TweenLite.to(mc_briqs, 2, {_alpha:0}));

timeline.append(TweenLite.to(mc_twice, 3, {_alpha:100}), -3.5);
timeline.append(TweenLite.to(mc_twice, 2, {_alpha:0}), -2);

timeline.append(TweenLite.to(mc_stove, 3, {_alpha:100}), -2);
timeline.append(TweenLite.to(mc_heart, 4, {_alpha:0, _xscale:100, _yscale:100}), -2);

timeline.append(TweenLite.to(mc_strip, 3, {_alpha:100}), -3);

timeline.append(TweenLite.to(mc_logo, 3, {_alpha:100}), -2);

 

Thanks again!

Link to comment
Share on other sites

Thanks again Carl,

 

Just one last thing... Is it possible to tween multiple items at the same time? I know the following code is wrong but hopefully gives an idea of what i'm trying to do?

 

timeline.append(TweenLite.to(mc_logo,mc_strip,mc_stove, 3, {_alpha:0}));

 

Cheers

 

Martin

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...