Tween is the underlying animation class for the effects in FlexJS.
The Tween class defines a tween, a property animation performed
on a target object over a period of time.
That animation can be a change in position, such as performed by
the Move effect; a change in size, as performed by the Resize or
Zoom effects; a change in visibility, as performed by the Fade or
Dissolve effects; or other types of animations.
A Tween instance accepts the startValue,
endValue, and duration properties,
and an optional easing function to define the animation.
[static]
The Tween.TWEEN_UPDATE constant defines the value of the
event object's type property for a tweenUpdate event.
Tween
Property Detail
activeTweens
property
public static var activeTweens:Object
The list of tweens that are currently playing.
currentTime
property
public static var currentTime:Number = NaN
Used by effects to get the current effect time tick.
easingFunction
property
easingFunction:Function [write-only]
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Sets the easing function for the animation.
The easing function is used to interpolate between
the startValue value and the endValue.
A trivial easing function does linear interpolation,
but more sophisticated easing functions create the illusion of
acceleration and deceleration, which makes the animation seem
more natural.
If no easing function is specified, an easing function based
on the Math.sin() method is used.
The easing function follows the function signature
popularized by Robert Penner.
The function accepts four arguments.
The first argument is the "current time",
where the animation start time is 0.
The second argument is a the initial value
at the beginning of the animation (a Number).
The third argument is the ending value
minus the initial value.
The fourth argument is the duration of the animation.
The return value is the interpolated value for the current time
(usually a value between the initial value and the ending value).
Flex includes a set of easing functions
in the mx.effects.easing package.
Implementation public function set easingFunction(value:Function):void
endValue
property
public var endValue:Number
Final value of the animation.
listener
property
public var listener:Object
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Object that is notified at each interval of the animation.
startValue
property
public var startValue:Number
Initial value of the animation.
Constructor Detail
Tween
()
Constructor
public function Tween()
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Constructor.
Method Detail
endTween
()
method
public function endTween():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Interrupt the tween, jump immediately to the end of the tween,
and invoke the onTweenEnd() callback function.
pause
()
method
override public function pause():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Pauses the effect until you call the resume() method.
play
()
method
override public function play():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Stops the tween, ending it without dispatching an event or calling
the Tween's endFunction or onTweenEnd().
resume
()
method
override public function resume():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Resumes the effect after it has been paused
by a call to the pause() method.
reverse
()
method
override public function reverse():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Plays the effect in reverse,
starting from the current position of the effect.
seek
()
method
public function seek(playheadTime:Number):void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Advances the tween effect to the specified position.
Parameters
playheadTime:Number — The position, in milliseconds, between 0
and the value of the duration property.
stop
()
method
override public function stop():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Stops the tween, ending it without dispatching an event or calling
the Tween's endFunction or onTweenEnd().
Constant Detail
TWEEN_END
Constant
public static const TWEEN_END:String = tweenEnd
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
The Tween.TWEEN_END constant defines the value of the
event object's type property for a tweenEnd event.
The properties of the event object have the following values:
Property
Value
bubbles
false
cancelable
false
currentTarget
The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget.
target
The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event.
public static const TWEEN_START:String = tweenStart
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
The Tween.TWEEN_START constant defines the value of the
event object's type property for a tweenStart event.
The properties of the event object have the following values:
Property
Value
bubbles
false
cancelable
false
currentTarget
The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget.
target
The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event.
value
The value passed to the
onTweenUpdate() method.
TWEEN_UPDATE
Constant
public static const TWEEN_UPDATE:String = tweenUpdate
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
The Tween.TWEEN_UPDATE constant defines the value of the
event object's type property for a tweenUpdate event.
The properties of the event object have the following values:
Property
Value
bubbles
false
cancelable
false
currentTarget
The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget.
target
The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event.