Jump to content
Search Community

Can I combine Two Tweens into One?

ngrinchenko test
Moderator Tag

Recommended Posts

I am working with the bezier tween. I wanted my mc to have different scale and alpha at different locations. Rather than specifying additional TweenMax.to instances running alongside the bezier tween I added scale and alpha inside the location brackets. It seems to work but I am not sure if I will have problems down the road, like some bugs due to the code manipulation. I also tried to add tinting options in the same manner but that did not work.

So here is how the original code looked:

TweenMax.to(mc, 5, {bezier:[{x:208, y:107}, {x:129, y:371}, {x:20, y:137}, {x:310, y:362}], orientToBezier:true, scaleX:1.7, scaleY:1.3, tint:0x99ccff, ease:Sine.easeIn});

and this is my modified code:

TweenMax.to(mc, 5, {bezier:[{x:231, y:117, scaleX:0.7, scaleY:0.3, alpha:0.2}, {x:109, y:351, scaleX:1.1, scaleY:0.7, alpha:0.9}, {x:49, y:147, scaleX:0.1, scaleY:0.7, alpha:0.2}, {x:840, y:582, scaleX:0.3, scaleY:0.7, alpha:0.9}], orientToBezier:true, scaleX:0.6, scaleY:0.7, tint:0xff0000, ease:Sine.easeIn});

Is it something I better not mess with or if it works - it works and will work without future bugs if it works now?

Link to comment
Share on other sites

You don't have to worry about those tweens suddenly not working in the future, no. The reason "tint" didn't work is because that's a special property that requires a plugin, but you can't put special properties INSIDE a bezier tween (which is a special property itself).

 

Here's a simple way of thinking about it - you can tween any of your target's properties (like "x", "y", "alpha"). But you can't do something like mc.tint - mc doesn't have a "tint" property. Nor does it have a "bezier" property. Those are special properties.

 

Make sense?

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