Packageflare.animate
Classpublic class Easing

Collection of easing functions to control animation rates. The methods of this class are intended to be used either (a) directly as values for the easing property of Transition instances, or (b) to generate such easing functions.

Many of these easing functions are adapted from Robert Penner's collection of easing functions.



Public Methods
 MethodDefined by
  
Constructor, throws an error if called, as this is an abstract class.
Easing
  
delegate(f:Function, ... args):Function
[static] A wrapper that specifies additional arguments to an easing function, such that the resulting function can be called with only the time.
Easing
  
easeInBack(t:Number, s:Number):Number
[static] Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing in: accelerating from zero velocity.
Easing
  
easeInBounce(t:Number):Number
[static] Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.
Easing
  
easeInCirc(t:Number):Number
[static] Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity.
Easing
  
easeInElastic(t:Number, a:Number, p:Number):Number
[static] Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity.
Easing
  
easeInExpo(t:Number):Number
[static] Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.
Easing
  
easeInOut(fi:Function, fo:Function):Function
[static] Composes any easeIn function with any easeOut function to create a custom ease-in/ease-out transition.
Easing
  
easeInOutBack(t:Number, s:Number):Number
[static] Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutBounce(t:Number):Number
[static] Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutCirc(t:Number):Number
[static] Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutElastic(t:Number, a:Number, p:Number):Number
[static] Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutExpo(t:Number):Number
[static] Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutPoly(exp:Number):Function
[static] Easing equation function generator for polynomial easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInOutSine(t:Number):Number
[static] Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration.
Easing
  
easeInPoly(exp:Number):Function
[static] Easing equation function generator for polynomial easing in: accelerating from zero velocity.
Easing
  
easeInSine(t:Number):Number
[static] Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity.
Easing
  
easeOutBack(t:Number, s:Number):Number
[static] Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing out: decelerating from zero velocity.
Easing
  
easeOutBounce(t:Number):Number
[static] Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
Easing
  
easeOutCirc(t:Number):Number
[static] Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.
Easing
  
easeOutElastic(t:Number, a:Number, p:Number):Number
[static] Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity.
Easing
  
easeOutExpo(t:Number):Number
[static] Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.
Easing
  
easeOutInBack(t:Number, s:Number):Number
[static] Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInBounce(t:Number):Number
[static] Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInCirc(t:Number):Number
[static] Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInElastic(t:Number, a:Number, p:Number):Number
[static] Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInExpo(t:Number):Number
[static] Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInPoly(exp:Number):Function
[static] Easing equation function generator for polynomial easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutInSine(t:Number):Number
[static] Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration.
Easing
  
easeOutPoly(exp:Number):Function
[static] Easing equation function generator for polynomial easing out: decelerating from zero velocity.
Easing
  
easeOutSine(t:Number):Number
[static] Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.
Easing
  
none(t:Number):Number
[static] Easing equation that does nothing, simply returns the input value.
Easing
Constructor detail
Easing()constructor
public function Easing()

Constructor, throws an error if called, as this is an abstract class.

Method detail
delegate()method
public static function delegate(f:Function, ... args):Function

A wrapper that specifies additional arguments to an easing function, such that the resulting function can be called with only the time.

Parameters
f:Function — The easing function to wrap
 
... args — A list of arguments. There should only be 1 or 2 arguments.

Returns
Function
easeInBack()method 
public static function easeInBack(t:Number, s:Number):Number

Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
s:Number — Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).

Returns
Number — The correct value.
easeInBounce()method 
public static function easeInBounce(t:Number):Number

Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInCirc()method 
public static function easeInCirc(t:Number):Number

Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInElastic()method 
public static function easeInElastic(t:Number, a:Number, p:Number):Number

Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
a:Number — Amplitude.
 
p:Number — Period.

Returns
Number — The correct value.
easeInExpo()method 
public static function easeInExpo(t:Number):Number

Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInOut()method 
public static function easeInOut(fi:Function, fo:Function):Function

Composes any easeIn function with any easeOut function to create a custom ease-in/ease-out transition.

Parameters
fi:Function — an ease-in function
 
fo:Function — an ease-out function

Returns
Function — the combined ease-in/ease-out function
easeInOutBack()method 
public static function easeInOutBack(t:Number, s:Number):Number

Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
s:Number — Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).

Returns
Number — The correct value.
easeInOutBounce()method 
public static function easeInOutBounce(t:Number):Number

Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInOutCirc()method 
public static function easeInOutCirc(t:Number):Number

Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInOutElastic()method 
public static function easeInOutElastic(t:Number, a:Number, p:Number):Number

Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
a:Number — Amplitude.
 
p:Number — Period.

Returns
Number — The correct value.
easeInOutExpo()method 
public static function easeInOutExpo(t:Number):Number

Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInOutPoly()method 
public static function easeInOutPoly(exp:Number):Function

Easing equation function generator for polynomial easing in/out: acceleration until halfway, then deceleration.

Parameters
exp:Number — The exponent of the polynomial (2 for quadration, 3 for cubic, etc)

Returns
Function — An ease-in, ease-out function using the polynomial x^exp
easeInOutSine()method 
public static function easeInOutSine(t:Number):Number

Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeInPoly()method 
public static function easeInPoly(exp:Number):Function

Easing equation function generator for polynomial easing in: accelerating from zero velocity.

Parameters
exp:Number — The exponent of the polynomial (2 for quadration, 3 for cubic, etc)

Returns
Function — An ease-in function using the polynomial x^exp
easeInSine()method 
public static function easeInSine(t:Number):Number

Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutBack()method 
public static function easeOutBack(t:Number, s:Number):Number

Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
s:Number — Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).

Returns
Number — The correct value.
easeOutBounce()method 
public static function easeOutBounce(t:Number):Number

Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutCirc()method 
public static function easeOutCirc(t:Number):Number

Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutElastic()method 
public static function easeOutElastic(t:Number, a:Number, p:Number):Number

Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
a:Number — Amplitude.
 
p:Number — Period.

Returns
Number — The correct value.
easeOutExpo()method 
public static function easeOutExpo(t:Number):Number

Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutInBack()method 
public static function easeOutInBack(t:Number, s:Number):Number

Easing equation function for a back (overshooting cubic easing: (s+1)^3 - s^2) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
s:Number — Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).

Returns
Number — The correct value.
easeOutInBounce()method 
public static function easeOutInBounce(t:Number):Number

Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutInCirc()method 
public static function easeOutInCirc(t:Number):Number

Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutInElastic()method 
public static function easeOutInElastic(t:Number, a:Number, p:Number):Number

Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).
 
a:Number — Amplitude.
 
p:Number — Period.

Returns
Number — The correct value.
easeOutInExpo()method 
public static function easeOutInExpo(t:Number):Number

Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutInPoly()method 
public static function easeOutInPoly(exp:Number):Function

Easing equation function generator for polynomial easing out/in: deceleration until halfway, then acceleration.

Parameters
exp:Number — The exponent of the polynomial (2 for quadration, 3 for cubic, etc)

Returns
Function — An ease-out, ease-in function using the polynomial x^exp
easeOutInSine()method 
public static function easeOutInSine(t:Number):Number

Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
easeOutPoly()method 
public static function easeOutPoly(exp:Number):Function

Easing equation function generator for polynomial easing out: decelerating from zero velocity.

Parameters
exp:Number — The exponent of the polynomial (2 for quadration, 3 for cubic, etc)

Returns
Function — An ease-out function using the polynomial x^exp
easeOutSine()method 
public static function easeOutSine(t:Number):Number

Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.
none()method 
public static function none(t:Number):Number

Easing equation that does nothing, simply returns the input value.

Parameters
t:Number — Current time (an animation fraction between 0 and 1).

Returns
Number — The correct value.