Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
spark.effects.easing 
EaseInOutBase 
Packagespark.effects.easing
Classpublic class EaseInOutBase
InheritanceEaseInOutBase Inheritance Object
Implements IEaser
Subclasses Power, Sine

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The EaseInOutBase class is the base class that provide easing capability. The EaseInOutBase class defines easing as consisting of two phases: the acceleration, or ease in phase, followed by the deceleration, or ease out phase. The default behavior of this class returns a linear interpolation for both easing phases. You can create a subclass of EaseInOutBase to get more interesting behavior.

MXML SyntaxexpandedHide MXML Syntax

The <s:EaseInOutBase> tag inherits all of the tag attributes of its of its superclass, and adds the following tag attributes:

  <s:EaseInOutBase
    id="ID"
    easeInFraction="0.5"
   />
  


Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  easeInFraction : Number
The percentage of an animation that should be spent accelerating.
EaseInOutBase
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
EaseInOutBase(easeInFraction:Number = NaN)
Constructor.
EaseInOutBase
  
ease(fraction:Number):Number
Takes the fraction representing the elapsed duration of an animation (a value between 0.0 to 1.0) and returns a new elapsed value.
EaseInOutBase
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Protected Methods
 MethodDefined By
  
easeIn(fraction:Number):Number
Returns a value that represents the eased fraction during the ease in phase of the animation.
EaseInOutBase
  
Returns a value that represents the eased fraction during the ease out phase of the animation.
EaseInOutBase
Property Detail

easeInFraction

property
easeInFraction:Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The percentage of an animation that should be spent accelerating. This factor sets an implicit "easeOut" parameter, equal to (1 - easeIn), so that any time not spent easing in is spent easing out. For example, to have an easing equation that spends half the time easing in and half easing out, set easeIn to .5.

Valid values are between 0.0 and 1.0.

The default value is .5.



Implementation
    public function get easeInFraction():Number
    public function set easeInFraction(value:Number):void
Constructor Detail

EaseInOutBase

()Constructor
public function EaseInOutBase(easeInFraction:Number = NaN)

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Parameters
easeInFraction:Number (default = NaN) — Sets the value of the easeInFraction property. The default value is EasingFraction.IN_OUT, which eases in for the first half of the time and eases out for the remainder.
Method Detail

ease

()method
public function ease(fraction:Number):Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Takes the fraction representing the elapsed duration of an animation (a value between 0.0 to 1.0) and returns a new elapsed value. This value is used to calculate animated property values. By changing the value of the elapsed fraction, you effectively change the animation of the property. For EaseInOutBase, this method calculates the eased fraction value based on the easeInFraction property. If fraction is less than easeInFraction, this method calls the easeIn() method. Otherwise it calls the easeOut() method. It is expected that these functions are overridden in a subclass.

Parameters

fraction:Number — The elapsed fraction of the animation.

Returns
Number — The eased fraction of the animation.

easeIn

()method 
protected function easeIn(fraction:Number):Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Returns a value that represents the eased fraction during the ease in phase of the animation. The value returned by this class is simply the fraction itself, which represents a linear interpolation of the fraction. More interesting behavior is implemented by subclasses of EaseInOutBase.

Parameters

fraction:Number — The fraction elapsed of the easing in phase of the animation, between 0.0 and 1.0.

Returns
Number — A value that represents the eased value for this phase of the animation.

easeOut

()method 
protected function easeOut(fraction:Number):Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Returns a value that represents the eased fraction during the ease out phase of the animation. The value returned by this class is simply the fraction itself, which represents a linear interpolation of the fraction. More interesting behavior is implemented by subclasses of EaseInOutBase.

Parameters

fraction:Number — The fraction elapsed of the easing out phase of the animation, between 0.0 and 1.0.

Returns
Number — A value that represents the eased value for this phase of the animation.