Jump to content
Search Community

killVars static method?

Philip Bulley test
Moderator Tag

Recommended Posts

If I started a tween like so:

 

TweenMax.to( mc, 5, {x:100, y:100} );

 

Is it possible to do something like:

 

TweenMax.killVars( mc, {y:true} );

 

I'd prefer to do without the hassle of keeping multiple instances of my tweens. Love using the static methods.

 

I'm using using v11.101.

 

Thanks

Link to comment
Share on other sites

Nope, sorry. You certainly can do a TweenMax.getTweensOf(mc) and loop through the resulting array and killVars() on each one. Or (not that this is a recommended best practice, but...) you could try doing a zero-duration y-tween to the current value just to trigger the auto overwriting of the "y" property. TweenMax.to(mc, 0, {y:mc.y}); I haven't tested that, but the idea just occurred to me. :)

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