Using Greensock Classes #in

Introduction

I’ve used various tweening engines over the years and have found those provided by Greensock to be the best. This post is intended to document my experience with the Greensock packages and provide quick links and tips for myself and others.

Greensock

The Greensock site is extensive and full of handy features and widgets, including, API Documentation, Interactive Demos, Learning ResourcesPluginExplorer. Also there is a forum full of helpful advice. The AS3 Tweening platform (v11) can be downloaded here: AS3.

Tween

TweenMax and TweenLite are the tween engines I tend to use, TweenMax is fully featured whilst as the name implies TweenLite is light weight and fast. The documentation gives plenty of examples to get you going with using the classes.

Plugins

Plugins can be used to extend the use of the tweening packages, using filters, tints and a host of others.

Club Greensock

The ‘Club‘ provides paid for  extras.

I had a big issue with a complex project I was working on where I had to rotate a large loaded image like a pendulum. For this the transformAroundPoint plugin was essential, and well worth the $50 fee.

TransformAroundPoint

My loaded images needed to rotate around a fixed point which was not the Loader’s registration point. ( Loaded Movies and Images always load to 0, 0)

An instructional video in the Learning resources Section explained the solution clearly: TransformAroundCenter Plugin Explained.

Also, I implemented transformMatrix to increase performance. From the tweening tips, also a forum post.

TweenLite.to(holder, duration, { transformAroundPoint:{point:new Point(FULCRUM_X_POSITION, FULCRUM_Y_POSITION)},

transformMatrix:{rotation:rotation},

delay:delay, onComplete:onSwingCompleted, onCompleteParams:array

});

Conclusion

I hope this has provided a good introduction to Greensock and proves useful to myself and others in the future.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s