GSkinner and TweenMax – recommendation and over-view.
Posted on 31. Mar, 2009 by thornyeternity in ActionScript 3 Snippets
The Adobe Tweens messed me round one too many times, with their tendency to just stop working. Tried out something from Exacimo (? link leads to very strange page) but settled on the mostly-free, reliant, light, easy to use, well-supported TweenMax by GSkinner (as in Grant).
If I weren’t in a new country with no credit card I would tip. So, instead – a recommendation and some quick code snippets for implementing.
Imports:
import gs.TweenMax;
import gs.easing.*;
import gs.events.*;
Declaring:
private var startTween:TweenMax;
Starting:
startTween = new TweenMax(extra_mc, fadeSpeed , {alpha:0 , overwrite:1});
//target, duration, property and value, handling of memory
Multiple Tweens in One Function:
var currTween = new TweenMax(whichframe, tweenSpeed , {x:xval , y:yval , rotation:rotval , ease:Circ.easeIn});
For color tint:
var currTween = TweenMax.to(this, tweenSpeed , {tint:0xE36F1E});
To Remove the Tint:
var currTween = TweenMax.to(this, tweenSpeed , {removeTint:true};
For Blur:
var currTween = TweenMax.to(this, 1, {blurFilter:{blurX:20 , blurY:20}});
For Glow:
var currTween = TweenMax.to(mc, 1, {glowFilter:{color:0x91e600, alpha:1, blurX:30, blurY:30}});
Events:
startTween.addEventListener(TweenEvent.COMPLETE , repeatFades);//not MOTION_FINISHED
repeatFades(event:Event);
//also – TweenEvent.UPDATE for each time value changes
Full Documentation & Notes:
Refer to www.tweenmax.com || http://blog.greensock.com
See also: GSkinner.com


