Jump to content
GreenSock

chrisatflash

Is there an autohide property after onComplete ?

Recommended Posts

Hello,

In my projects I usally the onComplete: param, and set the visibility of the object to false after it's done tweening.

 

TweenMax.to(mc, 1, { alpha:0, onComplete:hideAway });

function hideAway():void {

mc.visible = false;

}

 

I was wondering if there is a property like autohide? that does this automatically. If not, it would suggest it on the wish list if possible.

 

Regards,

Chris.

Link to comment
Share on other sites

yup, there is the visible plugin which will do exactly that like this:

 

import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([VisiblePlugin]);

TweenLite.to(mc, 1, {x:100, visible:false});

 

sample swf and video explanation here:

http://www.snorkl.tv/2011/02/five-hidde ... tweenlite/

 

enjoy,

 

Carl

 

ps: I was doing it your way for ages too:)

Link to comment
Share on other sites

And you can also use autoAlpha. Will set the visible to false after the tween hits 0 alpha

 

TweenMax.to(mc, 1, { autoAlpha:0 });

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