GreenSock


TweenMax (AS2) – TweenLite on Steroids

Posted in Tweening by jack on the April 5th, 2008
TweenMax by GreenSock   Download AS3 Download AS2 Donate
  • Version: 10.11, Updated 2/26/2009
  • Compatibility: Flash Player 8 and later (ActionScript 2) (click here for the AS3 version)
  • File Size added to SWF: About 7kb (base), or 14kb with default plugins

Join Club GreenSock to get bonus plugins, updates, and more

v11 Beta available - There are some very exciting things happening with the upcoming version 11 of the platform, including new sequencing tools (TimelineLite/Max) and a useFrames feature. I'd love to get your feedback and suggestions before officially launching it. Get details and download the code here.

RECENT VERSION HIGHLIGHTS

This is a big update. Please watch the "what's new in v10?" video and get more details on the official announcement page.

  • Plugin architecture - Most special properties (like "tint", "blurFilter", "frame", "bezier", etc.) are separated into optional "plugins" that can be activated (or not). This makes it possible to add only the features you need, minimizing file size and maximizing performance. Author your own plugins to handle whatever special properties you want too! This adds a whole new level of flexibility. And don't worry - all the necessary plugins necessary for backwards compatibility are activated inside the class by default.
  • TweenFilterLite retired - With the new plugin architecture, you can activate the filter plugins in TweenLite or TweenMax, so TweenFilterLite is obsolete.
  • New "frameLabel" feature - Tween to a frame label on the timeline of any MovieClip
  • New "remove", "index", and "addFilter" properties for filter tweens - Allows you to remove a filter when the tween completes, define a particular index number in the target DisplayObject's filters Array, and/or force TweenLite/Max to create a new filter even if there's a filter of the same kind already applied to a DisplayObject.
  • New "transformAroundCenter" feature - scale, rotate, or move a DisplayObject/MovieClip using its center as the origin regardless of where the actual registration point is. (membership benefit of Club GreenSock)
  • New "transformAroundPoint" feature - scale, rotate, or move a DisplayObject/MovieClip using any point as the origin regardless of where the object's registration point is. (membership benefit of Club GreenSock)
  • New "colorTransform" feature - Adds simple tweening of a MovieClip's "exposure", "brightness", or "tintAmount" as well as advanced colorTransform properties like redMultiplier, redOffset, greenMultiplier, etc.
  • Changed "shortRotation" syntax - Previously, shortRotation could only affect the "rotation" property of an object, not 3D rotations like rotationX, rotationY, and rotationZ. Now [after activating the shortRotation plugin] you can pass an object with any number of properties that should be affected, like TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:100}}).
  • Speed improvements - Up to 40% faster under heavy loads!
  • New "startAt" feature - Define starting values for your tweens
  • Eliminate allTo(), allFrom(), sequence(), and multiSequence() from TweenMax - TweenGroup offers the same functionality, plus a whole lot more flexibility and power.

DESCRIPTION

TweenMax extends the extremely lightweight, FAST TweenLite engine, adding many useful features like pause/resume, timeScale, AS3 Event listeners, reverse(), restart(), setDestination(), yoyo, loop, rounding, and the ability to jump to any point in the tween using the "progress" property. It also activates many extra plugins by default, making it extremely full-featured. Since TweenMax extends TweenLite, it can do ANYTHING TweenLite can do plus much more. Same syntax. There are plenty of other tweening engines out there to choose from, so here's why you might want to consider TweenMax:

  • SPEED - I'm not aware of any popular tweening engine with a similar feature set that's as fast as TweenMax. See the speed comparisons yourself.
  • Feature set - In addition to tweening ANY numeric property of ANY object, TweenMax can tween filters, hex colors, volume, tint, frames, saturation, contrast, hue, colorization, brightness, and even do bezier tweening, orientToBezier, pause/resume, reverse(), restart(), round values, jump to any point in the tween with the "progress" property, automatically rotate in the shortest direction, plus LOTS more. Overwrite management is an important consideration for a tweening engine as well which is another area where the GreenSock tweening platform shines. You have options for AUTO overwriting or you can manually define how each tween will handle overlapping tweens of the same object.
  • Expandability - With its new plugin architecture, you can activate as many (or as few) features as your project requires. Or write your own plugin if you need a feature that's unavailable. Minimize bloat, and maximize performance.
  • Management features - TweenGroup makes it surprisingly simple to create complex sequences and groups of TweenLite/Max tweens that you can pause(), resume(), restart(), or reverse(). You can even tween a TweenGroup's "progress" property to fastforward or rewind the entire group/sequence.
  • Ease of use - Designers and Developers alike rave about how intuitive the GreenSock tweening platform is.
  • Updates - Frequent updates and feature additions make the GreenSock tweening platform reliable and robust.
  • AS2 and AS3 - Most other engines are only developed for AS2 or AS3 but not both.

Other links: AS3 Version | Speed Comparison | TweenMax | Forums | TweenGroup | CustomEase

BASIC PROPERTY TWEENING INTERACTIVE DEMO

PLUGIN EXPLORER

USAGE

Every call to TweenMax.to() or TweenMax.from() returns a TweenMax instance which you can keep track of in order to have more control. Here are a few examples of how to create instances:

Actionscript:
  1. import gs.*;
  2. TweenMax.to(mc, 1, {x:200});
  3. var myTween:TweenMax = TweenMax.to(mc, 1, {x:200});
  4. var myTween:TweenMax = new TweenMax(mc, 1, {x:200}); //identical to the previous line - it just looks more object-oriented.

Each TweenMax instance has the following properties:

  • target : Object (changing target after the tween begins has no affect on the tween)
  • duration : Number
  • progress : Number - A number between 0 and 1 where 0 = tween hasn't progressed, 0.5 = tween is halfway done, and 1 = tween is finished
  • timeScale : Number - Multiplier for controlling the speed of the tween. 0.5 = half speed, 1 = normal speed, 2 = double speed, etc. (This value is combined with the globalTimeScale to give you lots of control)
  • paused : Boolean
  • reversed: Boolean

INSTANCE METHODS

TweenMax(target:Object, duration:Number, vars:Object):TweenMax
  • Description: Constructor. Property values are tweened from whatever they are at the time the tween begins to whatever you define in the variables parameter. (unless you use "runBackwards:true" which is the same as using TweenMax.from())
  • Parameters:
    1. target: Target object whose properties we're tweening. This can be ANY object, not just DisplayObjects/MovieClips
    2. duration: Duration (in seconds) of the tween
    3. vars: An object containing the end values of all the properties you'd like to have tweened (or if you're using the TweenMax.from() method, these variables would define the BEGINNING values). Putting quotes around values will make the tween relative to the current value. For example, _x:"-20" will tween _x to whatever it currently is minus 20 whereas _x:-20 will tween _x to exactly -20. To tween the _xscale and _yscale to 50, you'd do TweenMax.to(mc, 1, {_xscale:50, _yscale:50}); There are also some "special properties" that you can include in your vars object which perform special tasks, as described below:

      Special Properties:

      • delay : Number - The number of seconds you'd like to delay before the tween begins. This is very useful when sequencing tweens
      • ease : Function - You can specify a function to use for the easing with this variable. For example, gs.easing.Elastic.easeOut. The Default is a regular easeOut. To build a custom ease, check out the GreenSock CustomEase Builder tool.
      • easeParams : Array - An Array of extra parameter values to feed the easing equation. This can be useful when you use an equation like Elastic and want to control extra parameters like the amplitude and period. Most easing equations, however, don't require extra parameters so you won't need to pass in any easeParams.
      • onStart : Function - If you'd like to call a function as soon as the tween begins, pass in a reference to it here. This can be useful when there's a delay and you want something to happen just as the tween begins.
      • onStartParams : Array - An array of parameters to pass the onStart function.
      • onStartScope : Object - Defines the scope of the onStart call
      • onUpdate : Function - If you'd like to call a function every time the property values are updated (on every frame during the time the tween is active), pass a reference to it here.
      • onUpdateParams : Array - An array of parameters to pass the onUpdate function
      • onUpdateScope : Object - Defines the scope of the onUpdate call
      • onComplete : Function - If you'd like to call a function when the tween has finished, use this.
      • onCompleteParams : Array - An array of parameters to pass the onComplete function
      • onCompleteScope : Object - Defines the scope of the onComplete call
      • persist : Boolean - if true, the TweenMax instance will NOT automatically be removed by the garbage collector when it is complete. However, it is still eligible to be overwritten by new tweens even if persist is true. By default, it is false.
      • renderOnStart : Boolean - If you're using TweenMax.from() (or runBackwards:true) with a delay and want to prevent the tween from rendering until it actually begins, set this special property to true. By default, it's false which causes TweenMax.from() to render its values immediately, even before the delay has expired.
      • runBackwards : Boolean - Flips the start and end values in a tween. The from() method automatically sets this value to true.
      • overwrite : int - Controls how other tweens of the same object are handled when this tween is created. You can set a default value to be used with ALL tweens in your SWF using the OverwriteManager's init() method, or control them individually with this overwrite property. Here are the options:
        1. 0 (NONE): No tweens are overwritten. This is the fastest mode, but you need to be careful not to create any tweens with overlapping properties, otherwise they'll conflict with each other.
        2. 1 (ALL): (this is the default unless OverwriteManager.init() has been called) All tweens of the same object are completely overwritten immediately when the tween is created.
          TweenMax.to(mc, 1, {_x:100, _y:200});
          TweenMax.to(mc, 1, {_x:300, delay:2, overwrite:1}); //immediately overwrites the previous tween
        3. 2 (AUTO): (used by default if OverwriteManager.init() has been called) Searches for and overwrites only individual overlapping properties in tweens that are active when the tween begins.
          TweenMax.to(mc, 1, {_x:100, _y:200});
          TweenMax.to(mc, 1, {_x:300, overwrite:2}); //only overwrites the "_x" property in the previous tween
        4. 3 (CONCURRENT): Overwrites all tweens of the same object that are active when the tween begins.
          TweenMax.to(mc, 1, {_x:100, _y:200});
          TweenMax.to(mc, 1, {_x:300, delay:2, overwrite:3}); //does NOT overwrite the previous tween because the first tween will have finished by the time this one begins.
      • startAt : Object - By default, TweenMax uses whatever a target's current properties are at the beginning of the tween as the starting values, but if you prefer to manually define starting values, use "startAt". For example, if you want mc to tween from x/y coordinates of 0,0 to 100,100, do TweenMax.to(mc, 2, {_x:100, _y:100, startAt:{_x:0, _y:0}});
      • timeScale : Number - Multiplier for controlling the speed of the tween. 0.5 = half speed, 1 = normal speed, 2 = double speed, etc. (hint: if you want to gradually speed up or slow down a tween, you could get fancy and use another tween to tween the timeScale propety!). NOTE: There is also a static TweenMax.globalTimeScale property that affects ALL TweenMax and TweenFilterLite tweens (not TweenLite though)
      • roundProps : Array - If you'd like the inbetween values in a tween to always get rounded to the nearest integer, use the roundProps special property. Just pass in an Array containing the property names that you'd like rounded. For example, if you're tweening the x, y, and alpha properties of mc and you want to round the x and y values (not alpha) every time the tween is rendered, you'd do: TweenMax.to(mc, 2, {_x:300, _y:200, alpha:0.5, roundProps:["_x","_y"]});
      • yoyo : Number - To make the tween reverse when it completes (like a yoyo) any number of times, set this to the number of cycles you'd like the tween to yoyo. A value of zero causes the tween to yoyo endlessly.
      • loop : Number - To make the tween repeat when it completes any number of times, set this to the number of cycles you'd like the tween to loop. A value of zero causes the tween to loop endlessly.

pause():Void
  • Description: Pauses the tween. When a tween is paused, it's "paused" property is set to true.

resume():Void
  • Description: Resumes a paused tween. When a tween is resumed, it's "paused" property is set to false.

restart(includeDelay:Boolean):Void
  • Description: Restarts a tween from the beginning.
  • Parameters:
    1. includeDelay: Normally, restart() immediately starts the tween from the beginning (not including any delays), but if you'd like to include the delay in the calculations, set includeDelay to true.

reverse(adjustDuration:Boolean, forcePlay:Boolean):Void
  • Description: reverses the direction of a tween and even takes the ease into account so that if, for example, your tween used a Strong.easeOut, the reversed tween would appear to use Strong.easeIn for a more fluid transition.
  • Parameters:
    1. adjustDuration: Let's say you have a menu that tweens open when the user rolls over it, but then when the user takes some other action, the menu needs to snap back closed again. Setting adjustDuration to true causes the duration to adjust so that it takes the same amount of time to play the reversed tween as has already transpired. So if the menu tween had a duration of 2 seconds, but you reverse() it 1.5 seconds in, it will change the overall duration so that it takes 1.5 seconds to go back to the starting point. If adjustDuration is false, it would take 0.5 seconds to complete.
    2. forcePlay: Ensures that the tween plays immediately. If it is paused, it will resume. If it has finished, it will restart.

setDestination(property:String, value:Object, adjustStart:Boolean):Void
  • Description: Changes the destination value of a particular property in the tween. For example:
    Actionscript:
    1. var myTween:TweenMax = new TweenMax(mc, 2, {_x:500, _y:200});
    2. //then later, if you need to change the tween so that the "_x" property tweens to 100 instead of 500...
    3. myTween.setDestination("_x", 100); //even if the tween is in progress, the value will be updated

    This has a similar effect to changing the variables you pass into the TweenMax instance, but setDestination() can be used anytime whereas changing the vars object won't have any affect after the tween has begun and the start/end values are calculated. setDestination() is similar to Grant Skinner's "proxy" in gTween (which he did a GREAT job on as usual), but there are a few key differences: I believe that every time you change a property via gTween's proxy, the time resets. So if you have a 3-second tween, and then 2.5 seconds into it, you change the destination value, it'll tween for another 3 seconds and the easing will start over again as well. That's not necessarily bad at all - just something to keep in mind. TweenMax's setDestination() honors duration and continues the easing. Also, you can choose to have TweenMax adjust the start values of an in-progress tween to make it look seamless when the destination changes, or keep the start values and only update the end values (which can cause a sudden shift). And again, Grant's gTween is awesome - I hope my explanation of the differences in its "proxy" and TweenMax's setDestination() isn't perceived as me saying one is "better" than the other. Just different. I've got massive amounts of respect for Grant and all his work.

  • Parameters:
    1. property: The name of the property
    2. value: The new destination value
    3. adjustStart: Tweening basically takes a value from a start value to an end value over time. If a tween hasn't already begun, setting adjustStart to true or false will have the same effect. However, if the tween has already begun and you only update the destination values (adjustStart set to false), it can appear to suddenly jump to a new value. Think of it this way: If you're tweening "_x" from 0 to 100 with a Linear ease over the course of 10 seconds, at 5 seconds into the tween, "_x" would be 50. However, if you suddenly change the destination value from 100 to 10 and don't adjust the starting values, it will jump to a value of 5 because that's the new halfway point between the start (0) and destination (10). By default, setDestination() assumes you prefer a smooth change instead so that when you change the destination from 100 to 10 and it's halfway through the tween, it appears to smoothly continue the tween from 50 to 10. It will automatically adjust the starting values to do so. IMPORTANT: since the tween is half-way done in this example, it cannot simply use 50 as the starting value - it must shift it to 100 to offset it enough to aVoid the sudden jump. Since various easing equations can be used in your tween that new start value may be very different, though. It's easy to figure out with a Linear equation, but if you setDestination() when the tween is 90% done and it uses a Strong.easeIn equation, the new start value will be significantly offset. Beware of this if you setDestination() and then reverse() or yoyo() or loop()!

STATIC METHODS

TweenMax.to(target:Object, duration:Number, vars:Object):TweenMax
  • Description: Creates a new TweenMax instance for you, but shields you from having to create a variable to store it in which can make garbage collection more difficult.
    Actionscript:
    1. var myTween:TweenMax = new TweenMax(mc, 1, {_x:300});
    2.     TweenMax.to(mc, 1, {_x:300}); //exactly the same as the previous line, but handles garbage collection automatically.

  • Parameters: Same as Constructor (see above)

TweenMax.from(target:Object, duration:Number, vars:Object):TweenMax
  • Description: Exactly the same as TweenMax.to(), but instead of tweening the properties from where they're at currently to whatever you define, this tweens them the opposite way - from where you define TO where ever they are now (when the method is called). This is handy for when things are set up on the stage the way the should end up and you just want to tween them to where they are.
  • Parameters: Same as TweenMax.to(). (see above)

TweenMax.getTweensOf(target:Object):Array
  • Description: Returns an Array of all tweens affecting the target object.
  • Parameters:
    1. target : Object - The object whose tweens you want to get.

TweenMax.isTweening(target:Object):Boolean
  • Description: Checks to see if a particular object is currently being tweened (paused tweens don't count).
  • Parameters:
    1. target : Object - The object whose tweens you want to check.

TweenMax.getAllTweens():Array
  • Description: Returns an Array of all tweens (including paused tweens).

TweenMax.delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array, onCompleteScope:Object, persist:Boolean):Void
  • Description: Provides an easy way to call any function after a specified number of seconds. Any number of parameters can be passed to that function when it's called too.
  • Parameters:
    1. delay : Number - Number of seconds before the function should be called.
    2. onComplete : Function - The function to call
    3. onCompleteParams : Array - An Array of parameters to pass the onComplete function when it's called.
    4. onCompleteScope : Object - Defines the scope of the function call (only useful in AS2).
    5. persist : Boolean - If you plan to reuse or restart this delayedCall TweenMax instance, set persist to true so that it doesn't get removed from the rendering queue when it completes.

TweenMax.killTweensOf(target:Object, complete:Boolean):Void
  • Description: Provides an easy way to kill all tweens of a particular Object. You can optionally force it to immediately complete (which will also call the onComplete function if you defined one)
  • Parameters:
    1. target : Object - All tweens of this Object will be killed.
    2. complete : Boolean - If true, the tweens for this object will immediately complete (go to the ending values and call the onComplete function if you defined one).

TweenMax.killDelayedCallsTo(function:Function):Void
  • Description: Provides an easy way to kill all delayed calls to a particular function (ones that were instantiated using the TweenMax.delayedCall() method).
  • Parameters:
    1. function : Function - All delayed calls to this function will be killed.

TweenMax.killAllTweens(complete:Boolean):Void
  • Description: Kills ALL tweens (but not delayedCalls).
  • Parameters:
    1. complete: Boolean - If you'd like to force the tweens to complete, set this to true. (it's false by default)

TweenMax.killAllDelayedCalls(complete:Boolean):Void
  • Description: Kills ALL delayedCalls.
  • Parameters:
    1. complete: Boolean - If you'd like to force the delayedCall to complete, set this to true. (it's false by default)

TweenMax.pauseAll(tweens:Boolean, delayedCalls:Boolean):Void
  • Description: Provides a way to pause all TweenMax tweens and/or delayedCalls (not TweenLite tweens or delayedCalls).
  • Parameters:
    1. tweens: To pause tweens, set this to true. (it is true by default)
    2. delayedCalls: To pause delayedCalls, set this to true. (it is false by default)

TweenMax.resumeAll(tweens:Boolean, delayedCalls:Boolean):Void
  • Description: Resumes all TweenMax tweens
  • Parameters:
    1. tweens: To resume tweens, set this to true. (it is true by default)
    2. delayedCalls: To resume delayedCalls, set this to true. (it is false by default)

TweenMax.removeTween(tween:TweenLite):Void
  • Description: Kills a single tween instance.
  • Parameters:
    1. tween: The TweenMax/TweenLite instance that you'd like to kill.

TweenMax.setGlobalTimeScale(scale:Number):Void
  • Description: Speed up or slow down ALL TweenMax tweens. Each tween's timeScale property and the TweenMax.globalTimeScale are cumulative, giving you lots of control. So, for example, if an individual tween has a timeScale of 0.5 and you set the globalTimeScale to 0.5 as well, the tween will appear to run at 0.25 speed. If you want the globalTimeScale to gradually change, you can even tween it using TweenLite (which isn't affected by globalTimeScale), like this: TweenLite.to(TweenMax, 1, {globalTimeScale:0.5});
  • Parameters:
    1. scale : Number - Multiplier for controlling the speed of the tweens. 0.5 = half speed, 1 = normal speed, 2 = double speed, etc.

EXAMPLES

To tween the "clip_mc" MovieClip over 5 seconds, changing the _alpha to 50%, _x to 120 using the Back.easeOut easing function, delay starting the whole tween by 2 seconds, and then call a function named "onFinishTween" when it has completed and pass in a few parameters to that function (a value of 5 and a reference to the clip_mc), you'd do so like:

Actionscript:
  1. import gs.*;
  2. import gs.easing.*;
  3.  
  4. TweenMax.to(clip_mc, 5, {_alpha:0.5, _x:120, ease:Back.easeOut, delay:2, onComplete:onFinishTween, onCompleteParams:[5, clip_mc]});
  5. function onFinishTween(argument1:Number, argument2:MovieClip):Void {
  6.     trace("The tween has finished! argument1 = " + argument1 + ", and argument2 = " + argument2);
  7. }

If you have a MovieClip on the stage that is already in it's end position and you just want to animate it into place over 2 seconds (drop it into place by changing its _y property to 100 pixels higher on the screen and dropping it from there), you could:

Actionscript:
  1. import gs.*;
  2. import gs.easing.*;
  3.  
  4. TweenMax.from(clip_mc, 2, {_y:"-100", ease:Elastic.easeOut});

FAQ

  1. Is the new version of TweenLite/Max backwards compatible?
    The short answer is "yes", but I'd strongly encourage you to check out the "what's new in v10?" video on the official announcement page for details.
  2. How do I activate extra plugins?
    Check out the Plugin Explorer above. Not only does it provide interactive examples of each plugin, but it also writes the activation code for you and shows how many kb the plugins will cost.
  3. How do I install the class? Do I have to import it on every frame?
    Just make sure the "gs" folder from the download is in the same folder as your FLA file. Keep the class files in the "gs" folder (don't remove them). That's it. And, yes, just like any Class, you need to import TweenMax at the top of any frame that contains code referencing it. This does NOT add extra kb to your file size every time you import it. Flash is smart enough to embed it once and all the other import statements just act as a "pointer" to the embedded Class.
  4. How do I pause/resume a tween?
    Simple. First, you need to keep track of the TweenMax instance. Whenever you do a to() or from() tween, the function returns a reference to that particular tween, or just do a "new TweenMax()" call to the constructor. Then call pause() or resume() on it whenever you please, like this:

    Actionscript:
    1. var myTween:TweenMax = new TweenMax(mc, 2, {colorMatrixFilter:{colorize:0xFF0000, amount:1}});
    2. myTween.pause();
    3. myTween.resume();

  5. Can I set up a sequence of tweens so that they occur one after the other?
    Of course! That's precisely what TweenGroup is for. But if file size is a huge concern, you could just use the delay property. Here's an example where we colorize a MovieClip red over the course of 2 seconds, and then move it to a y coordinate of 300 over the course of 1 second:

    Actionscript:
    1. import gs.*;
    2. TweenMax.to(clip_mc, 2, {tint:0xFF0000});
    3. TweenMax.to(clip_mc, 1, {y:300, delay:2});

  6. Do the properties have to be in a specific order?
    Nope. The only thing that matters is that the first parameter is the object you're tweening, the second parameter is the time (in seconds), and the third parameter contains all the properties you want to tween (in any order). So TweenMax.to(clip_mc, 1, {colorMatrixFilter:{colorize:0xFF0000, amount:1}}) is the same as TweenMax.to(clip_mc, 1, {colorMatrixFilter:{amount:1, colorize:0xFF0000}});
  7. Is there a way I can get code hinting and strict datatyping in TweenLite/TweenMax?
    Sure, I developed some utility classes to do just that. Learn more here.
  8. Do I have to purchase a license to use this code? Can I use it for commercial purposes?
    You may use the code at no charge in commercial or non-commercial web sites, games, components, applications, and other software as long as end users are not charged a fee of any kind to use your product or gain access to it. If your client pays you a one-time fee to create the site/product, that's perfectly fine and qualifies under the "no charge" license. If end users are charged a usage/access/license fee, please simply sign up for a corporate Club GreenSock membership which comes with a special commercial license granting you permission to do so. See http://blog.greensock.com/club/ for details. Club GreenSock members get some bonus plugins/classes, update notifications, and more. Your donations keep this project going. Please see the licensing page for details on licensing.

Need Help?

Feel free to post your question on the forums. You'll increase your chances of getting a prompt answer if you provide a brief explanation and include a simplified FLA file (and any class files) that clearly demonstrates the problem.

Author: Jack Doyle, (e-mail: jack -at- greensock.com)
Copyright 2009, GreenSock (This work is subject to the terms here.)

To download the code, you must agree to the following license:

Copyright 2009, GreenSock, Inc.

"NO CHARGE" NON-EXCLUSIVE SOFTWARE LICENSE AGREEMENT

-----------------------------------------------------------------------------
PLAIN ENGLISH SUMMARY:

  1. You may use the code at no charge in commercial or non-commercial web sites, games, components, applications, and other software as long as end users are not charged a fee of any kind to use your product or gain access to it. If your client pays you a one-time fee to create the site/product, that's perfectly fine and qualifies under the "no charge" license. If end users are charged a usage/access/license fee, please sign up for a corporate Club GreenSock membership which comes with a special commercial license granting you permission to do so. See http://blog.greensock.com/club/ for details.
  2. Use at your own risk. I offer no warranties.
  3. Please respect the copyright.

-----------------------------------------------------------------------------

LEGALESE:

This is a legal agreement between you (either an individual or a single entity) and GreenSock, Inc. ("GREENSOCK") for the proprietary GreenSock ActionScript code known as TweenLite, TweenMax, TweenGroup, OverwriteManager, and other code that is freely available for download at http://blog.greensock.com or http://www.greensock.com (this code and documentation, as well as any updates which may at GREENSOCK's sole discretion be provided to you from time to time, are referred to in this Agreement as "PROGRAM") By downloading, copying, or otherwise using the PROGRAM, you agree to the terms and conditions of this Agreement. If you do not agree to the terms and conditions of this Agreement, please do not download or use the PROGRAM.

I. LICENSE
A. Subject to the terms and conditions of this Agreement, GREENSOCK hereby grants you a non-exclusive, worldwide, non-transferable right to use the PROGRAM in web sites, games, applications, components and other software for which the end user is NOT charged any fees. If you would like to use the code in a commercially licensed software product for which end users are charged a fee (either for usage or access), simply sign up for a corporate Club GreenSock membership at http://blog.greensock.com/club/.

II. LIMITATION OF LICENSE AND RESTRICTIONS
A. You agree that you will not disclose, sell, rent, or license the PROGRAM's source code or any derivative works thereof to any third party without the prior written consent of GREENSOCK. Derivative works are defined as modifications that add substantive functionality to the PROGRAM and do not include bug fixes or other minor modifications required to operate the PROGRAM as originally intended. Distribution of the source code as part of your Work Product is acceptable so long as the recipients agree to the terms of this Agreement. You agree not to modify or delete GreenSock's existing copyright notice located in the source code.

B. You may use, duplicate, and distribute the compiled object code as embedded in a Work Product created by you, either for your own use or for distribution to a third party so long as end users of the Work Product are not charged a fee for usage. Please see http://blog.greensock.com/licensing/ for descriptions of Work Products that qualify for the "No Charge" license.

III. CONSIDERATION
A. The license rights granted to you under this Agreement are at no charge, but only in the following circumstances: If, either on your own behalf or on behalf of a third party, you incorporate the Software into a web site, software application, program or any component thereof (collectively, "Work Product"), which in the case of a web site, must be accessible to internet users without payment of a fee of any kind by a user, and in the case of a software application, program or component, neither you nor anyone to whom you distribute the Work Product charges a user a fee of any kind to use such Work Product or application, program or component into which such Work Product is embedded. The foregoing shall apply regardless of whether you are paid to create such Work Product.

B. In the event your intended use of the Software does not meet the criteria for the "no charge" license rights set forth in the immediately preceding paragraph, then you are not licensed to use the PROGRAM under this Agreement and must license the PROGRAM under GreenSock’s separate fee-based Software License Agreement which is granted to corporate Club GreenSock members (see http://blog.greensock.com/club/ for details).

IV. TITLE AND OWNERSHIP
A. The PROGRAM is licensed, not sold, and is protected by copyright laws and international treaty provisions. You acknowledge that no title to the intellectual property in the PROGRAM is transferred to you. You further acknowledge that title and full ownership rights to the PROGRAM, including all intellectual property rights therein, will remain the exclusive property of GreenSock and you will not acquire any rights to the PROGRAM except as expressly set forth in this Agreement. You agree that any copies of the PROGRAM you make will contain the same proprietary notices which appear on and in the PROGRAM.

V. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
A. THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. GREENSOCK DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE PROGRAM WILL MEET YOUR REQUIREMENTS OR THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE. GREENSOCK shall not be liable for special, indirect, incidental, or consequential damages with respect to any claim on account of or arising from this Agreement or use of the PROGRAM, even if GREENSOCK has been or is hereafter advised of the possibility of such damages. Because some states do not allow certain exclusions or limitations on implied warranties or of liability for consequential or incidental damages, the above exclusions may not apply to you. In no event, however, will GREENSOCK be liable to you, under any theory of recovery, in an amount in excess of the license fee paid by you under this Agreement. Notwithstanding anything else in this agreement, you agree to indemnify GREENSOCK, its assignees, and licensees, and hold each of them harmless from and against any and all claims, demands, losses, damages, liabilities, costs, and expenses, including legal fees.

B. GREENSOCK may, at its sole discretion, provide support services related to the PROGRAM, but has no obligation to do so.

VI. TERMINATION
GreenSock may terminate this Agreement at any time if you fail to comply with the terms and conditions of this Agreement.

VII. MISCELLANEOUS
A. This Agreement shall be construed in accordance with the laws of the State of Illinois. Should you for any reason bring a claim, demand, or other action against GREENSOCK, its agents or employees, arising out of this Agreement or the PROGRAM licensed herein, you agree to bring said claim only in the Illinois Court of Claims.

B. THIS AGREEMENT REPRESENTS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN GREENSOCK AND YOU AND SUPERSEDES ALL PRIOR AGREEMENTS, PROPOSALS, REPRESENTATIONS AND OTHER COMMUNICATIONS, VERBAL OR WRITTEN, BETWEEN THEM WITH RESPECT TO USE OF THE PROGRAM. THIS AGREEMENT MAY BE MODIFIED ONLY WITH THE MUTUAL WRITTEN APPROVAL OF AUTHORIZED REPRESENTATIVES OF THE PARTIES.

C. The terms and conditions of this Agreement shall prevail notwithstanding any different, conflicting, or additional terms or conditions which may appear in any purchase order or other document submitted by you. You agree that such additional or inconsistent terms are deemed rejected by GREENSOCK.

D. GREENSOCK and you agree that any xerographically or electronically reproduced copy of this Agreement shall have the same legal force and effect as any copy bearing original signatures of the parties.

I'd like to donate & get bonus classes, update notifications, SVN access, and more.

10 Responses to 'TweenMax (AS2) – TweenLite on Steroids'

Subscribe to comments with RSS

  1. Luis Grolez said,

    on April 6th, 2008 at 2:42 am

    Cool TweenMax, I was waiting for this class for a long time,
    I really like the way I be able to control curves,
    Congrats to bring it out,
    Luis

  2. Iulian said,

    on April 7th, 2008 at 6:23 am

    When using TwenMax.from() with a delay, take a look at this code:

    TweenMax.from(mc1, 2, {blurFilter:{blurX:50, quality:2}, ease:Strong.easeOut, overwrite:false, delay:2});

    The blurFilter is applied from start, it doesn’t wait for the delay.

  3. jack said,

    on April 7th, 2008 at 10:15 am

    Actually, Iulian, that’s exactly the way it’s supposed to work. The from() method will apply the values immediately UNLESS you pass in “renderOnStart:true”. This is because usually when people use the from() method, they WANT the values to be applied immediately. For example, I’ll often have stuff build onto the screen in a staggered way, so I’ll put them at their end positions on the stage, then use a bunch of from() calls to make them fly/fade into place, and I’ll use delays. But if the values only got applied when the delay expired, you’d see a bunch of stuff on the screen initially, then they’d disappear and fly/fade on – see what I mean? But if that’s what you want, the renderOnStart:true is precisely what you need.

  4. Dario said,

    on April 11th, 2008 at 7:08 am

    Awesome! I was waiting for something like this even before the internet was invented! I used Fuse before this mainly because of it’s chain animation feature. But now with TweenMax, goodbye Fuse forever!

  5. Claes said,

    on April 15th, 2008 at 6:26 pm

    You made my day!
    Thankyouthankyouthankyou

  6. FeRcHiTo said,

    on April 30th, 2008 at 5:48 pm

    OUTSTANDING !!! today u wrote a new page on my life as flash designer! speechless.

  7. Maikel said,

    on August 31st, 2008 at 9:09 pm

    Amazing!
    Pure beauty, this is by far the best tweening library I’ve ever used.
    None of the other libraries compare to this.

    Great work, keep it up.
    Thank you.


  8. on November 27th, 2008 at 5:39 am

    Jack, You rock! Great class

  9. Stringycustard said,

    on December 8th, 2008 at 11:32 am

    I’ve been using this class for a while, and I’m really appreciating the time it’s saved me throughout all my projects. Thanks, man.

  10. Bryan said,

    on January 5th, 2009 at 6:37 pm

    This is excellent! I’ve been pulling my hair out dealing with the inherent Tween Class in AS2. It’s very poor dealing with multiple tweens but this tool works GREAT.

    Thank you!!! And keep up the good work :)

    Cheers