Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Jeremy Rudd

EndArrayPlugin vs regular TweenLite tweening

Recommended Posts

Hi all,

 

I wanted to know how the EndArrayPlugin is different from the regular TweenLite? Comparing:

var myArray:Array = [1,2,3,4];
TweenLite.to(myArray, 1.5, [10,20,30,40]);

 

And the alternate EndArray syntax:

var myArray:Array = [1,2,3,4];
TweenLite.to(myArray, 1.5, {endArray:[10,20,30,40]});

 

How would that be different? And I looked at the code in EndArrayPlugin, it supports round on/off which TweenLite does not? Is that the only difference or is there more?

 

They both work, I've tested them.

Link to post
Share on other sites

Technically that first tween is malformed - the vars object is supposed to be a generic object with enumerative properties, but your example works nevertheless. What happens if you want an onUpdate or onComplete? That would be impossible if you pass a raw array as the vars parameter.

 

So yes, using the EndArrayPlugin allows you to not only tap into all the other features of the tweening engine (like setting an ease, using callbacks, etc.) but it also does work with RoundPropsPlugin.

  • Like 1
Link to post
Share on other sites

Sorry to sound dumb, but the EndArray plugin only works with rounding, it has no other benefits? Apart from the better syntax?

 

Thanks for the quick replies, Jack.

Link to post
Share on other sites

No, it's not just rounding - it also permits you to use onComplete, onUpdate, onstart, onreverseComplete, ease, delay, useFrames, overwrite, etc. Plus it uses proper syntax. But besides that, there are no benefits ;)

Link to post
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.

×