Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The Linear class defines an easing with three phases:
acceleration, uniform motion, and deceleration.
As the animation starts it accelerates through the period
specified by the
easeInFraction
property, it
then uses uniform (linear) motion through the next phase, and
finally decelerates until the end during the period specified
by the
easeOutFraction
property.
The easing values for the three phases are calculated
such that the behavior of constant acceleration, linear motion,
and constant deceleration all occur within the specified
duration of the animation.
Strict linear motion can be achieved by setting
easeInFraction
and easeOutFraction
to 0.0.
Note that if acceleration or
deceleration are not 0.0, then the motion during the middle
phase is not at the same speed as that of pure
linear motion. The middle phase consists of
uniform motion, but the speed of that motion is determined by
the size of that phase relative to the overall animation.
Show MXML Syntax
Hide MXML Syntax The <s:Linear>
tag
inherits all of the tag attributes of its of its superclass,
and adds the following tag attributes:
<s:Linear
id="ID"
easeInFraction="0"
easeOutFraction="0"
/>
easeInFraction:Number
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The fraction an animation spent accelerating,
between 0.0 and 1.0.
The values of the easeOutFraction
property
and easeInFraction
property must satisfy the
equation easeOutFraction + easeInFraction <= 1
where any remaining time is spent in the linear motion phase.
The default value is 0.
Implementation public function get easeInFraction():Number
public function set easeInFraction(value:Number):void
easeOutFraction:Number
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The percentage an animation will spend decelerating,
between 0.0 and 1.0.
The values of the easeOutFraction
property
and easeInFraction
property must satisfy the
equation easeOutFraction + easeInFraction <= 1
where any remaining time is spent in the linear motion phase.
The default value is 0.
Implementation public function get easeOutFraction():Number
public function set easeOutFraction(value:Number):void
public function Linear(easeInFraction:Number = 0, easeOutFraction:Number = 0)
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
Parameters | easeInFraction:Number (default = 0 ) — The fraction of the overall duration
in the acceleration phase, between 0.0 and 1.0.
|
|
| easeOutFraction:Number (default = 0 ) — The fraction of the overall duration
in the deceleration phase, between 0.0 and 1.0.
|
public function ease(fraction:Number):Number
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Calculates the eased fraction value based on the
easeInFraction
and easeOutFraction
properties.
If fraction
is less than easeInFraction
, it calculates a value
based on accelerating up to the linear motion phase.
If fraction
is greater than easeInFraction
and less than
(1-easeOutFraction)
, it calculates a value based
on the linear motion phase between the easing in and easing out phases.
Otherwise, it calculates a value based on constant deceleration
between the linear motion phase and 0.0.
Parameters
| fraction:Number — The elapsed fraction of the animation,
between 0.0 and 1.0..
|
Returns | Number — The eased fraction of the animation.
|
© 2009 Adobe Systems Incorporated. All rights reserved.
Sat Oct 3 2009, 04:15 AM -07:00