Packageaway3d.animators
Classpublic class PathAnimator
InheritancePathAnimator Inheritance flash.events.EventDispatcher

Public Properties
 PropertyDefined by
  aligntopath : Boolean
PathAnimator
  duration : int
PathAnimator
  easein : Boolean
PathAnimator
  easeout : Boolean
PathAnimator
  fps : int
PathAnimator
  index : int
PathAnimator
  object3d : *
PathAnimator
  objectRotations : Number3D
[read-only] returns the actual rotations of the object3D;
PathAnimator
  offset : Number3D
PathAnimator
  offsetTime : Number
[write-only] set the saved time back to a lower time to avoid mesh rotation Y of 180.
PathAnimator
  offsetX : Number
PathAnimator
  offsetY : Number
PathAnimator
  offsetZ : Number
PathAnimator
  orientation : Number3D
[read-only] returns the actual interpolated rotation along the path;
PathAnimator
  path : Path
PathAnimator
  pathlength : Number
[read-only] returns the segment count of the path
PathAnimator
  position : Number3D
[read-only] returns the actual tweened pos on the path with no optional offset applyed
PathAnimator
  rotations : Array
PathAnimator
  targetobject : *
PathAnimator
  time : Number
[read-only] returns the actual time on the path.a Number from 0 to 1
PathAnimator
Public Methods
 MethodDefined by
  
PathAnimator
(path:Path, object3d:Object, init:* = null)
Creates a new PathAnimator
PathAnimator
  
addOnChangeSegment(listener:Function):void
Default method for adding a segmentchange event listener.
PathAnimator
  
addOnCycle(listener:Function):void
Default method for adding a cycle event listener.
PathAnimator
  
addOnRange(listener:Function, from:Number = 0, to:Number = 0):void
Default method for adding a range event listener.
PathAnimator
  
animateOnPath(startFrom:Number = 0):void
Update automatically the tween.
PathAnimator
  
clearTime():void
clear the tween array in order to start from another time on the path, if the animateOnPath handler is being used
PathAnimator
  
Returns a position on the path according to duration/elapsed time.
PathAnimator
  
getPositionOnPath(p:Number3D, t:Number):void
Updates a position Number3D on the path at a given time.
PathAnimator
  
getTimeElapsed():Number
Returns the elapsed time along the path.
PathAnimator
  
getTimeSegment(t:Number):Number
returns the segment index that is used at a given time;
PathAnimator
  
removeOnChangeSegment(listener:Function):void
Default method for removing a range event listener
PathAnimator
  
removeOnCycle(listener:Function):void
Default method for removing a cycle event listener
PathAnimator
  
removeOnRange(listener:Function):void
Default method for removing a range event listener
PathAnimator
  
update(t:Number):void
Calculates the new position and set the object on the path accordingly
PathAnimator
  
updateTimeElapsed(d:Number):Number
Default method for removing a range event listener
PathAnimator
Property detail
aligntopathproperty
aligntopath:Boolean  [read-write]Implementation
    public function get aligntopath():Boolean
    public function set aligntopath(value:Boolean):void
durationproperty 
duration:int  [read-write]Implementation
    public function get duration():int
    public function set duration(value:int):void
easeinproperty 
easein:Boolean  [read-write]Implementation
    public function get easein():Boolean
    public function set easein(value:Boolean):void
easeoutproperty 
easeout:Boolean  [read-write]Implementation
    public function get easeout():Boolean
    public function set easeout(value:Boolean):void
fpsproperty 
fps:int  [read-write]Implementation
    public function get fps():int
    public function set fps(value:int):void
indexproperty 
index:int  [read-write]Implementation
    public function get index():int
    public function set index(value:int):void
object3dproperty 
object3d:*  [read-write]Implementation
    public function get object3d():*
    public function set object3d(value:*):void
objectRotationsproperty 
objectRotations:Number3D  [read-only]

returns the actual rotations of the object3D;

Implementation
    public function get objectRotations():Number3D
offsetproperty 
offset:Number3D  [read-write]Implementation
    public function get offset():Number3D
    public function set offset(value:Number3D):void
offsetTimeproperty 
offsetTime:Number  [write-only]

set the saved time back to a lower time to avoid mesh rotation Y of 180.

Implementation
    public function set offsetTime(value:Number):void
offsetXproperty 
offsetX:Number  [read-write]Implementation
    public function get offsetX():Number
    public function set offsetX(value:Number):void
offsetYproperty 
offsetY:Number  [read-write]Implementation
    public function get offsetY():Number
    public function set offsetY(value:Number):void
offsetZproperty 
offsetZ:Number  [read-write]Implementation
    public function get offsetZ():Number
    public function set offsetZ(value:Number):void
orientationproperty 
orientation:Number3D  [read-only]

returns the actual interpolated rotation along the path;

Implementation
    public function get orientation():Number3D
pathproperty 
path:Path  [read-write]Implementation
    public function get path():Path
    public function set path(value:Path):void
pathlengthproperty 
pathlength:Number  [read-only]

returns the segment count of the path

Implementation
    public function get pathlength():Number
positionproperty 
position:Number3D  [read-only]

returns the actual tweened pos on the path with no optional offset applyed

Implementation
    public function get position():Number3D
rotationsproperty 
rotations:Array  [read-write]Implementation
    public function get rotations():Array
    public function set rotations(value:Array):void
targetobjectproperty 
targetobject:*  [read-write]Implementation
    public function get targetobject():*
    public function set targetobject(value:*):void
timeproperty 
time:Number  [read-only]

returns the actual time on the path.a Number from 0 to 1

Implementation
    public function get time():Number
Constructor detail
PathAnimator()constructor
public function PathAnimator(path:Path, object3d:Object, init:* = null)Parameters
path:Path — path A Path object. The _path definition.
 
object3d:Object — object3d An Object, defines the object to be animated along the path. The object of any kind must have 3 public properties "x,y,z". Note: if an rotations array is passed, the object must have rotationX, Y and Z public properties as well.
 
init:* (default = null) — init [optional] An initialisation object for specifying default instance properties. Default is null.
Init Parameters
 duration:Number (default = 1000, min:0)
 lookat:Boolean (default = false)
 aligntopath:Boolean (default = !_lookAt)
 easein:Boolean (default = false)
 easeout:Boolean (default = false)
 fps:Int (default = 20, min:0)
 offset:Number3D
 rotations:Array
 targetobject:Object (default = null)
Method detail
addOnChangeSegment()method
public function addOnChangeSegment(listener:Function):void

Default method for adding a segmentchange event listener. Event fired when the time pointer reads another CurveSegment. Note that it's not triggered if the value time is decreasing along the path.

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

Default method for adding a cycle event listener. Event fired when the time reaches 0.999999999 or higher.

Parameters
listener:Function — The listener function
addOnRange()method 
public function addOnRange(listener:Function, from:Number = 0, to:Number = 0):void

Default method for adding a range event listener. Event fired when the time is >= from and <= to variables.

Parameters
listener:Function — listener The listener function
 
from:Number (default = 0)
 
to:Number (default = 0)
animateOnPath()method 
public function animateOnPath(startFrom:Number = 0):void

Update automatically the tween. Note that if you want to use a more extended tween engine like Tweener. Use the "update" handler.

Parameters
startFrom:Number (default = 0) — A Number from 0 to 1. Note: this will have fx on the next iteration on the Path, if you want it start at this point, use clearTime handler first.
clearTime()method 
public function clearTime():void

clear the tween array in order to start from another time on the path, if the animateOnPath handler is being used

getDurationOnPath()method 
public function getDurationOnPath(p:Number3D, d:Number):Number3D

Returns a position on the path according to duration/elapsed time. Duration variable must be set.

Parameters
p:Number3D — p Number3D. An empty Number3D that will be returned with the location on path at a given time in ms.
 
d:Number — d Number. A number representing a time in ms. returns Number3D The position at a given elapsed time, compared to total duration.

Returns
Number3D
getPositionOnPath()method 
public function getPositionOnPath(p:Number3D, t:Number):void

Updates a position Number3D on the path at a given time. Do not use this handler to animate, it's in there to add dummy's or place camera before or after the animated object. Use the update() or the automatic tweened animateOnPath() handlers instead.

Parameters
p:Number3D — Number3D. The Number3D to update according to the "t" time parameter.
 
t:Number — Number. A Number from 0 to 1

See also

animateOnPath
update
getTimeElapsed()method 
public function getTimeElapsed():Number

Returns the elapsed time along the path. duration variable must be set for this function returns Number. The elapsed time compared to total duration

Returns
Number
getTimeSegment()method 
public function getTimeSegment(t:Number):Number

returns the segment index that is used at a given time;

Parameters
t:Number — t [Number]. A Number between 0 and 1. If no params, actual pathanimator time segment index is returned.

Returns
Number
removeOnChangeSegment()method 
public function removeOnChangeSegment(listener:Function):void

Default method for removing a range event listener

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

Default method for removing a cycle event listener

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

Default method for removing a range event listener

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

Calculates the new position and set the object on the path accordingly

Parameters
t:Number — A Number from 0 to 0.999999999 (less than one to allow alignToPath)
updateTimeElapsed()method 
public function updateTimeElapsed(d:Number):Number

Default method for removing a range event listener

Parameters
d:Number — d Number. A number representing a time in ms. Duration variable must be set. returns Number. The elapsed time compared to total duration

Returns
Number
Wiki link
Click to go to the wiki page for 'away3d.animators.PathAnimator'

Code examples

Comments