AbstractTween

Kind of class:public class
Package:com.bourre.transitions
Inherits from:AbstractSyncCommand < AbstractCommand
Implements:
Known subclasses:
Author:Cédric Néhémie
Classpath:com.bourre.transitions.AbstractTween
File last modified:Monday, 24 November 2008, 11:36:57

Summary


Constructor
  • AbstractTween (target:Object, setter:String, endValue:Number, duration:Number, startValue:Number = NaN, easing:Function = null, getter:String = null)
Class methods
  • noEasing (t:Number, b:Number, c:Number, d:Number) : Number
Instance methods
Event handlers
  • onTick (e:Event = null) : void
    • Method called by the {VISDOC_CODE_BLOCK_5} for each
  • onUpdate : void

Constructor

AbstractTween

public function AbstractTween (
target:Object, setter:String, endValue:Number, duration:Number, startValue:Number = NaN, easing:Function = null, getter:String = null)

Class methods

noEasing

public static function noEasing (
t:Number, b:Number, c:Number, d:Number) : Number

Instance methods

addEventListener

public function addEventListener (
type:String, listener:Object, rest) : Boolean

Adds the passed-in listener as listener for the passed-in event type.
#
Parameters:
type :
name of the event type.
#
listener:
object to be added as listener.
#
Returns:
  • {VISDOC_CODE_BLOCK_8} if the object have been succesfully added as
    listener for the passed-in event type
    #

addListener

public function addListener (
listener:TweenListener) : Boolean

Adds the passed-in listener object as listener for
all events dispatched by the tween. The object must
implements the {VISDOC_CODE_BLOCK_5} interface.
#
Parameters:
listener:
object to be added as listener.
#
Returns:
  • {VISDOC_CODE_BLOCK_6} if the object have been succesfully
    added as listener for this object
    #

execute

override public function execute (
e:Event = null) : void

Overrides:
  • AbstractSyncCommand.execute

getDuration

public function getDuration (
) : Number

getEasing

public function getEasing (
) : Function

getEndValue

public function getEndValue (
) : Number

getPlayHeadPosition

public function getPlayHeadPosition (
) : Number

getProperty

public function getProperty (
) : String

getStartValue

public function getStartValue (
) : Number

getTarget

public function getTarget (
) : Object

isMotionFinished

public function isMotionFinished (
) : Boolean

isReversed

public function isReversed (
) : Boolean

isReversedMotionFinished

public function isReversedMotionFinished (
) : Boolean

removeEventListener

public function removeEventListener (
type:String, listener:Object) : Boolean

Removes the passed-in listener for listening the passed-in event type.
#
Parameters:
type :
name of the event type.
#
listener:
object to be removed as listener.
#
Returns:
  • {VISDOC_CODE_BLOCK_9} if the object have been succesfully remove as
    listener for the passed-in event type
    #

removeListener

public function removeListener (
listener:TweenListener) : Boolean

Removes the passed-in listener from listening all events
dispatched by this tween.
#
Parameters:
listener:
object to be removed as listener.
#
Returns:
  • {VISDOC_CODE_BLOCK_7} if the object have been succesfully removed
    as listener for this object
    #

reset

public function reset (
) : void

setDuration

public function setDuration (
n:Number) : void

setEasing

public function setEasing (
f:Function) : void

Defines the easing function used by this {VISDOC_CODE_BLOCK_2} object.

Easing function can't be null, concret implementation must provide
a default function if no function is defined, or if the passed-in
function is {VISDOC_CODE_BLOCK_3}.

#
Parameters:
f:
easing function for this tween, the function must implements
the following signature :
function easingFunc( t : Number, b : Number, c : Number, d : Number ) : Number
Where :
  • {VISDOC_CODE_BLOCK_4} is the elapsed time since start in milliseconds
  • {VISDOC_CODE_BLOCK_5} is the the start value
  • {VISDOC_CODE_BLOCK_6} is the size of the value range such{VISDOC_CODE_BLOCK_7}
  • {VISDOC_CODE_BLOCK_8} is the duration of the tween in milliseconds
  • the returned value is the the interpolated value
#
Specified by:

setEndValue

public function setEndValue (
n:Number) : void

setPlayHeadPosition

public function setPlayHeadPosition (
n:Number) : void

setProperty

public function setProperty (
p:String) : void

setReversed

public function setReversed (
b:Boolean) : void

setStartValue

public function setStartValue (
n:Number) : void

setTarget

public function setTarget (
o:Object) : void

start

public function start (
) : void

stop

public function stop (
) : void

Event handlers

onTick

public function onTick (
e:Event = null) : void

Method called by the {VISDOC_CODE_BLOCK_5} for each
step of time according to its time slicing approach.

The {VISDOC_CODE_BLOCK_6} method is very similar to the
old {VISDOC_CODE_BLOCK_7} method, but doesn't specifically
occurs when entering in a new frame of a frame-based animation.
The tick could be the result of a {VISDOC_CODE_BLOCK_8} call,
or a change in the timecode of a video.

#
Parameters:
e:
event dispatched by the beacon object
#
Specified by:

onUpdate

public function onUpdate (
) : void