Packagecom.desuade.motion.controllers
Classpublic dynamic class MultiController
InheritanceMultiController Inheritance Object
Subclasses PhysicsMultiController

Language Version : ActionScript 3
Since : 02.07.2009
Runtime Versions : AIR 1.0, Flash Player 9.0.0

Manages multiple MotionControllers under one controller for a single target.



Public Properties
 PropertyDefined By
  active : Boolean
[read-only] This returns true if any of the child controllers are active.
MultiController
  duration : Number
Sets/gets the duration for all child controllers
MultiController
  target : Object
The target for all child controllers
MultiController
Public Methods
 MethodDefined By
  
MultiController(target:Object, duration:Number = 0, properties:Array = null, containerClass:Class = null, tweenClass:Class = null)
Creates a new MultiController.
MultiController
  
addController(property:String, containerClass:Class = null):MotionController
Creates a new child controller for the given property
MultiController
  
addKeyframes(position:Number, keyframes:Object, label:String = null):void
Adds a keyframe with the same label across all controllers at the same position.
MultiController
  
fromXML(xml:XML, usealldurations:Boolean = true):MultiController
Configures the MultiController and creates all child MotionControllers.
MultiController
  
setKeyframes(keyframe:String, properties:Object):void
This lets you configure a specific keyframe for each controller at once.
MultiController
  
start(keyframe:String = begin, startTime:Number = 0, rebuild:Boolean = false):*
This starts all child MotionControllers at once.
MultiController
  
stop():void
This stops all child MotionControllers at once
MultiController
  
toXML():XML
This creates an XML object representing the MultiController and it's child MotionControllers.
MultiController
Property Detail
activeproperty
active:Boolean  [read-only]

This returns true if any of the child controllers are active. It will only return false if all the controllers are inactive.


Implementation
    public function get active():Boolean
durationproperty 
duration:Number

Sets/gets the duration for all child controllers


Implementation
    public function get duration():Number
    public function set duration(value:Number):void
targetproperty 
target:Object

The target for all child controllers


Implementation
    public function get target():Object
    public function set target(value:Object):void
Constructor Detail
MultiController()Constructor
public function MultiController(target:Object, duration:Number = 0, properties:Array = null, containerClass:Class = null, tweenClass:Class = null)

Creates a new MultiController. This controller creates MotionControllers to manage multiple properties on a single target object.

Each property under this MultiController is a MotionController that is used to tween the target's same property (this['x'] == target['x'])

Parameters
target:Object — The target object to set for all child MotionControllers
 
duration:Number (default = 0) — The length of time to set all child controllers
 
properties:Array (default = null) — An array of strings of child MotionControllers to create - ex: ['x', 'y', 'alpha']
 
containerClass:Class (default = null) — The class of keyframe container to use for all MotionControllers
 
tweenClass:Class (default = null) — The class of tweens to pass to all the keyframe container
Method Detail
addController()method
public function addController(property:String, containerClass:Class = null):MotionController

Creates a new child controller for the given property

Parameters

property:String — The property to have controlled
 
containerClass:Class (default = null) — The KeyframeContainer class to use

Returns
MotionController — The MotionController added.
addKeyframes()method 
public function addKeyframes(position:Number, keyframes:Object, label:String = null):void

Adds a keyframe with the same label across all controllers at the same position.

Parameters

position:Number — The position to add the keyframe (0-1)
 
keyframes:Object — An object that has each controller and keyframe object - ex: {x:{value:'200', spread:'50'}, y:{value:0}, alpha:{ease:Sine.easeIn, value:.3}}
 
label:String (default = null) — The label for the keyframe

fromXML()method 
public function fromXML(xml:XML, usealldurations:Boolean = true):MultiController

Configures the MultiController and creates all child MotionControllers.

Parameters

xml:XML — The XML object to use for configuration
 
usealldurations:Boolean (default = true) — If true, this uses all original durations for each controller. If false, all durations are set to the MultiController's duration value.

Returns
MultiController — The MultiController object (for chaining)
setKeyframes()method 
public function setKeyframes(keyframe:String, properties:Object):void

This lets you configure a specific keyframe for each controller at once.

Parameters

keyframe:String — The label of the keyframe to set
 
properties:Object — An object that has the properties of each controller - ex: {controller1:{value:40, spread:80}, controller3:{ease:Bounce.easeOut, value:5}}

start()method 
public function start(keyframe:String = begin, startTime:Number = 0, rebuild:Boolean = false):*

This starts all child MotionControllers at once. If a keyframe label is specified, each controller will be started at the given keyframe.

Parameters

keyframe:String (default = begin) — The label of the keyframe to start the controllers at.
 
startTime:Number (default = 0) — This is like keyframe, but instead uses actual time to start at, as if it's already been running. This overrides the keyframe param.
 
rebuild:Boolean (default = false) — Forces a rebuild of each MotionControllers internal sequence on start.

Returns
* — The MultiController (for chaining)
stop()method 
public function stop():void

This stops all child MotionControllers at once

toXML()method 
public function toXML():XML

This creates an XML object representing the MultiController and it's child MotionControllers.

Returns
XML — And XML object for the MultiController