Jump to content
GreenSock

yelle77

Tween in and tween out

Recommended Posts

Im new to all this and im sure what im after is very simple so can anyone help?

 

I want a movieclips alpha to tween into alpha:1 stay like that for say 5 seconds and then tween back out to alpha:0 again.

 

Can this be done in tweenlite? or do i need one of the other tweening platforms?

Link to comment
Share on other sites

Hi and Welcome to the GreenSock forums,

 

Yes, TweenMax would be the best solution for this:

 

mc.alpha = 0;
TweenMax.to(mc, 1, {alpha:1, repeat:1, yoyo:true, repeatDelay:5});

 

If you are using TweenLite, you could put a delay on the tween that fades the item out like so:

 


mc.alpha = 0;
TweenLite.to(mc, 1, {alpha:1});
TweenLite.to(mc, 1, {alpha:0, delay:5});

 

The solutions above are for v12/AS3 (recommended)

 

If you are using the previous version of the platform (v11) you will have to add this line to the beginning of the 2nd example:

OverwriteManager.init(2);

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