API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class FastEase

Package | com.greensock.easing
Class | public class FastEase

TweenMax (AS3 only) has built-in algorithms that speed up the processing of certain easing equations but in order to take advantage of those optimizations, you must activate the easing equations first (you only need to activate them ONCE in your swf). The following easing equations from the com.greensock.easing package are eligible for activation: `

- Linear (easeIn, easeOut, easeInOut, and easeNone)
- Quad (easeIn, easeOut, and easeInOut)
- Cubic (easeIn, easeOut, and easeInOut)
- Quart (easeIn, easeOut, and easeInOut)
- Quint (easeIn, easeOut, and easeInOut)
- Strong (easeIn, easeOut, and easeInOut)

` EXAMPLE
`import com.greensock.easing.
//activate the optimized ease classes
FastEase.activate([Strong, Linear, Quad]);
//then tween as usual (you don't have to do anything special in your tweens)
TweenMax.to(mc, 2, {x:200, ease:Linear.easeNone});
` Once activated, the easing calculations run about 35-80% faster! Keep in mind that the easing calculations are only one small part of the tweening engine, so you may only see a 2-15% improvement overall depending on the equation and quantity of simultaneous tweens. Notes:

- TweenLite does NOT have the internal algorithms in place to take advantage of optimized eases at this time (to conserve file size).
- Activating an ease multiple times doesn't hurt or help

Public Methods

| Method | Defined by
--- | --- | ---
|  | activate(easeClasses:Array):void [static] TweenMax (AS3 only) has built-in algorithms that speed up the processing of certain easing equations but in order to take advantage of those optimizations, you must activate the easing equations first (you only need to activate them ONCE in your swf). | FastEase
|  | activateEase(ease:Function, type:int, power:uint):void [static] Normally you should use the `FastEase.activate()` method to activate optimized eases, but if you want to activate an ease that is NOT in the com.greensock.easing package (for example `fl.motion.easing.Quadratic`), you can register individual easing equations with this method. | FastEase

Method detail

activate | () | method

`public static function activate(easeClasses:Array):void`

TweenMax (AS3 only) has built-in algorithms that speed up the processing of certain easing equations but in order to take advantage of those optimizations, you must activate the easing equations first (you only need to activate them ONCE in your swf). The following easing equations from the com.greensock.easing package are eligible for activation: ``

- Linear (easeIn, easeOut, easeInOut, and easeNone)
- Quad (easeIn, easeOut, and easeInOut)
- Cubic (easeIn, easeOut, and easeInOut)
- Quart (easeIn, easeOut, and easeInOut)
- Quint (easeIn, easeOut, and easeInOut)
- Strong (easeIn, easeOut, and easeInOut)

EXAMPLE
`import com.greensock.easing.
FastEase.activate([Strong, Linear, Quad]);
` Notes:

- TweenLite does NOT have the internal algorithms in place to take advantage of optimized eases at this time (to conserve file size).
- Activating an ease multiple times doesn't hurt or help

Parameters

| `easeClasses:Array` — An Array containing the easing classes to activate, like [Strong, Linear, Quad]. It will automatically activate the easeIn, easeOut, easeInOut, and (if available) easeNone easing equations for each class in the Array.

activateEase | () | method |

`public static function activateEase(ease:Function, type:int, power:uint):void`

Normally you should use the `FastEase.activate()` method to activate optimized eases, but if you want to activate an ease that is NOT in the com.greensock.easing package (for example `fl.motion.easing.Quadratic`), you can register individual easing equations with this method. For example: `import fl.motion.easing.Quadratic;
import com.greensock.easing.FastEase;
FastEase.activateEase(Quadratic.easeIn, 1, 1);`

Parameters

| `ease:Function` — The easing equation (function) to activate. For example, Quadratic.easeIn
| `type:int` — The type of ease (in, out, or inOut) where easeIn is 1, easeOut is 2, and easeInOut is 3.
| `power:uint` — The magnitude or power of the ease. For example, Linear is 0, Quad is 1, Cubic is 2, Quart is 3 and Quint and Strong are 4.