Packagecom.greensock.easing
Classpublic class OutIn
InheritanceOutIn Inheritance Ease

OutIn is a configurable ease that decelerates initially, then moves linearly for a certain portion of the ease (which you can choose) and then accelerates again at the end which is great for effects like zooming text into place on the screen, smoothly moving it long enough for people to read it, and then zooming it off the page. Without OutIn, animators would often try to get the same effect by sequencing 3 tweens, one with an easeOut, then another with a Linear.easeNone, and finally an easeIn but the problem was that the eases didn't smoothly transition into one another, so you'd see sudden shifts in velocity at the joints. OutIn solves this problem and gives you complete control over how strong the eases are on each end and what portion of the movement in the middle is linear.

The first parameter, linearRatio, determines the proportion of the ease during which the rate of change will be linear (steady pace). This should be a number between 0 and 1. For example, 0.5 would be half, so the first 25% of the ease would be easing out (decelerating), then 50% would be linear, then the final 25% would be easing in (accelerating). If you choose 0.8, that would mean 80% of the ease would be linear, leaving 10% on each end to ease. The default is 0.7.

The second parameter, power, determines the strength of the ease at each end. If you define a value greater than 1, it will actually reverse the linear portion in the middle which can create interesting effects. The default is 0.7.


Example
Example AS3 example:
import com.greensock.*;
import com.greensock.easing.*;

//use the default OutIn ease (linearRatio of 0.7 and power of 0.7)
TweenLite.to(mc, 5, {x:600, ease:OutIn.ease});

//use a new OutIn ease with 50% of the tween being linear (2.5 seconds) and a power of 0.8
TweenLite.to(mc, 5, {x:600, ease:new OutIn(0.5, 0.8)});
 
//this gives the exact same effect as the line above, but uses a different syntax
TweenLite.to(mc, 5, {x:600, ease:OutIn.ease.config(0.5, 0.8)});

Copyright 2012, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.



Public Properties
 PropertyDefined by
  ease : OutIn
[static] The default ease instance which can be reused many times in various tweens in order to conserve memory and improve performance slightly compared to creating a new instance each time.
OutIn
Public Methods
 MethodDefined by
  
OutIn(linearRatio:Number = 0.7, power:Number = 0.7)
Constructor
OutIn
  
config(linearRatio:Number = 0.7, power:Number = 0.7):OutIn
Permits customization of the ease with various parameters.
OutIn
  
getRatio(p:Number):Number
Translates the tween's progress ratio into the corresponding ease ratio.
OutIn
Property detail
easeproperty
public static var ease:OutIn

The default ease instance which can be reused many times in various tweens in order to conserve memory and improve performance slightly compared to creating a new instance each time.

Constructor detail
OutIn()constructor
public function OutIn(linearRatio:Number = 0.7, power:Number = 0.7)

Constructor

Parameters
linearRatio:Number (default = 0.7) — the proportion of the ease during which the rate of change will be linear (steady pace). This should be a number between 0 and 1. For example, 0.5 would be half, so the first 25% of the ease would be easing out (decelerating), then 50% would be linear, then the final 25% would be easing in (accelerating). If you choose 0.8, that would mean 80% of the ease would be linear, leaving 10% on each end to ease. The default is 0.7.
 
power:Number (default = 0.7) — The strength of the ease at each end. If you define a value above 1, it will actually reverse the linear portion in the middle which can create interesting effects. The default is 0.7.
Method detail
config()method
public function config(linearRatio:Number = 0.7, power:Number = 0.7):OutIn

Permits customization of the ease with various parameters.

Parameters
linearRatio:Number (default = 0.7) — the proportion of the ease during which the rate of change will be linear (steady pace). This should be a number between 0 and 1. For example, 0.5 would be half, so the first 25% of the ease would be easing out (decelerating), then 50% would be linear, then the final 25% would be easing in (accelerating). If you choose 0.8, that would mean 80% of the ease would be linear, leaving 10% on each end to ease. The default is 0.7.
 
power:Number (default = 0.7) — The strength of the ease at each end. If you define a value above 1, it will actually reverse the linear portion in the middle which can create interesting effects. The default is 0.7.

Returns
OutIn — new OutIn instance that is configured according to the parameters provided
getRatio()method 
public override function getRatio(p:Number):Number

Translates the tween's progress ratio into the corresponding ease ratio. This is the heart of the Ease, where it does all its work.

Parameters
p:Number — progress ratio (a value between 0 and 1 indicating the progress of the tween/ease)

Returns
Number — translated number