Packageaway3d.animators
Classpublic class Animator
InheritanceAnimator Inheritance flash.events.EventDispatcher
SubclassesBonesAnimator, PathAnimator, VertexAnimator

Base class for all animator objects.

Public Properties
 PropertyDefined by
  currentFrame : int
[read-only] Returns the current keyframe number
Animator
  cycleNumber : int
[read-only] Returns the number of the current loop cycle
Animator
  delay : Number
Defines the delay to the start of the animation in seconds
Animator
  fps : Number
Defines the keyframes per second of the animation
Animator
  interpolate : Boolean
Defines whether the animation interpolates between channel points.
Animator
  isPlaying : Boolean
[read-only] Returns true when the animation is playing
Animator
  length : Number
Defines the total length of the animation in seconds
Animator
  loop : Boolean
Defines whether the animation will loop.
Animator
  name : String
The name of the animation used as a unique reference.
Animator
  progress : Number
Represents the progress of the animation playhead from the start (0) to the end (1) of the animation.
Animator
  target : Object3D
Defines the 3d object to which the animation is applied.
Animator
  totalFrames : Number
[read-only] Returns the total length of the animation in frames
Animator
Protected Properties
 PropertyDefined by
  _currentFrame : int
Animator
  _fraction : Number
Animator
  ini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.
Animator
  _invFraction : Number
Animator
  _progress : Number = 0
Animator
  _target : Object3D
Animator
  _time : Number
Animator
Public Methods
 MethodDefined by
  
Animator
(target:Object3D = null, init:Object = null)
Creates a new Animator object.
Animator
  
addOnCycle(listener:Function):void
Default method for adding a cycle event listener.
Animator
  
addOnEnterKeyFrame(listener:Function):void
Default method for adding an enterKeyFrame event listener
Animator
  
clone(animator:Animator = null):Animator
Duplicates the animators properties to another Animator object
Animator
  
gotoAndPlay(frame:uint):void
Animator
  
gotoAndStop(frame:uint):void
Animator
  
play():void
Animator
  
removeOnCycle(listener:Function):void
Default method for removing a cycle event listener
Animator
  
removeOnEnterKeyFrame(listener:Function):void
Default method for removing a enterKeyFrame event listener
Animator
  
stop():void
Animator
  
update(time:Number):void
Updates the position of the playhead to the given time in seconds.
Animator
Protected Methods
 MethodDefined by
  
getDefaultFps():Number
Animator
  
updateProgress(val:Number):void
Animator
  
updateTarget():void
Animator
Events
 EventSummaryDefined by
   Dispatched when a looping animation starts a new cycle.Animator
   Dispatched when entering a new keyframe.Animator
   Dispatched when the animation starts.Animator
   Dispatched when the animation stops.Animator
Property detail
_currentFrameproperty
protected var _currentFrame:int
currentFrameproperty 
currentFrame:int  [read-only]

Returns the current keyframe number

Implementation
    public function get currentFrame():int
cycleNumberproperty 
cycleNumber:int  [read-only]

Returns the number of the current loop cycle

Implementation
    public function get cycleNumber():int
delayproperty 
public var delay:Number

Defines the delay to the start of the animation in seconds

fpsproperty 
public var fps:Number

Defines the keyframes per second of the animation

_fractionproperty 
protected var _fraction:Number
iniproperty 
protected var ini:Init

Instance of the Init object used to hold and parse default property values specified by the initialiser object in the 3d object constructor.

interpolateproperty 
public var interpolate:Boolean

Defines whether the animation interpolates between channel points. Defaults to true.

_invFractionproperty 
protected var _invFraction:Number
isPlayingproperty 
isPlaying:Boolean  [read-only]

Returns true when the animation is playing

Implementation
    public function get isPlaying():Boolean
lengthproperty 
length:Number  [read-write]

Defines the total length of the animation in seconds

Implementation
    public function get length():Number
    public function set length(value:Number):void
loopproperty 
public var loop:Boolean

Defines whether the animation will loop. Defaults to true.

nameproperty 
public var name:String

The name of the animation used as a unique reference.

_progressproperty 
protected var _progress:Number = 0
progressproperty 
progress:Number  [read-write]

Represents the progress of the animation playhead from the start (0) to the end (1) of the animation.

Implementation
    public function get progress():Number
    public function set progress(value:Number):void
_targetproperty 
protected var _target:Object3D
targetproperty 
target:Object3D  [read-write]

Defines the 3d object to which the animation is applied.

Implementation
    public function get target():Object3D
    public function set target(value:Object3D):void
_timeproperty 
protected var _time:Number
_totalFramesproperty 
arcane var _totalFrames:Number = 0
totalFramesproperty 
totalFrames:Number  [read-only]

Returns the total length of the animation in frames

Implementation
    public function get totalFrames():Number
Constructor detail
Animator()constructor
public function Animator(target:Object3D = null, init:Object = null)Parameters
target:Object3D (default = null) — [optional] Defines the 3d object to which the animation is applied.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
Init Parameters
 progress:Number (default = 0)
 fps:Number (default = getDefaultFps()
 loop:Boolean (default = true)
 interpolate:Boolean (default = true)
 delay:Number (default = 0)
Method detail
addOnCycle()method
public function addOnCycle(listener:Function):void

Default method for adding a cycle event listener.

Parameters
listener:Function — The listener function
addOnEnterKeyFrame()method 
public function addOnEnterKeyFrame(listener:Function):void

Default method for adding an enterKeyFrame event listener

Parameters
listener:Function — listener The listener function
clone()method 
public function clone(animator:Animator = null):Animator

Duplicates the animators properties to another Animator object

Parameters
animator:Animator (default = null) — [optional] The new animator instance into which all properties are copied

Returns
Animator — The new animator instance with duplicated properties applied
getDefaultFps()method 
protected function getDefaultFps():Number

Returns
Number
gotoAndPlay()method 
public function gotoAndPlay(frame:uint):void Parameters
frame:uint
gotoAndStop()method 
public function gotoAndStop(frame:uint):void Parameters
frame:uint
play()method 
public function play():void
removeOnCycle()method 
public function removeOnCycle(listener:Function):void

Default method for removing a cycle event listener

Parameters
listener:Function — listener The listener function
removeOnEnterKeyFrame()method 
public function removeOnEnterKeyFrame(listener:Function):void

Default method for removing a enterKeyFrame event listener

Parameters
listener:Function — listener The listener function
stop()method 
public function stop():void
update()method 
public function update(time:Number):void

Updates the position of the playhead to the given time in seconds.

Parameters
time:Number — Defines the time in seconds of the playhead of the animation.
updateProgress()method 
protected function updateProgress(val:Number):void Parameters
val:Number
updateTarget()method 
protected function updateTarget():void
Event detail
cycleevent 
Event object type: away3d.events.AnimatorEvent

Dispatched when a looping animation starts a new cycle.

See also

enterKeyFrameevent  
Event object type: away3d.events.AnimatorEvent

Dispatched when entering a new keyframe.

startevent  
Event object type: away3d.events.AnimatorEvent

Dispatched when the animation starts.

stopevent  
Event object type: away3d.events.AnimatorEvent

Dispatched when the animation stops.

Wiki link
Click to go to the wiki page for 'away3d.animators.Animator'

Code examples

Comments