Packagecom.desuade.partigen.controllers
Classpublic dynamic class ParticleController
InheritanceParticleController Inheritance Object

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

This is created by an emitter to manage and control all the particle motion controller configurations.



Public Properties
 PropertyDefined By
  colorTweenClass : Class
[static] The default colortween class to use for emitter controllers
ParticleController
  tweenClass : Class
[static] The default tween class to use for emitter controllers
ParticleController
Public Methods
 MethodDefined By
  
This creates a ParticleController.
ParticleController
  
addBeginValue(property:String, value:*, spread:* = 0, precision:int = 0, extras:Object = null):ParticleTweenController
This sets the initial value of the given property.
ParticleController
  
addColorTween(property:String = color, duration:Number = 0):ParticleTweenController
This creates a ParticleTweenController that is specific for color tweening.
ParticleController
  
addPhysics(property:String, duration:Number = 0, flip:Boolean = false, useAngle:Boolean = true):ParticlePhysicsController
This creates a ParticlePhysicsController (which is like a PhysicsMultiController) that has 3 ParticleTweenControllers for each physics property: velocity, acceleration, and friction.
ParticleController
  
addTween(property:String, duration:Number = 0):ParticleTweenController
This creates a ParticleTweenController for the given property.
ParticleController
  
This configures the ParticleController from XML and creates all child controllers.
ParticleController
  
toXML():XML
Creates an XML object containing configuration for the ParticleController
ParticleController
Property Detail
colorTweenClassproperty
public static var colorTweenClass:Class

The default colortween class to use for emitter controllers

tweenClassproperty 
public static var tweenClass:Class

The default tween class to use for emitter controllers

Constructor Detail
ParticleController()Constructor
public function ParticleController()

This creates a ParticleController. This is created automatically by the emitter and does not need to be called on it's own.

Method Detail
addBeginValue()method
public function addBeginValue(property:String, value:*, spread:* = 0, precision:int = 0, extras:Object = null):ParticleTweenController

This sets the initial value of the given property. If the property exists as a ParticleTweenController already, it will modify the current 'begin' keyframe. If it doesn't, this creates a new ParticleTweenController and sets its 'begin' keyframe.

Note: this only sets ParticleTweenControllers, NOT ParticlePhysicsControllers.

Parameters

property:String — The particle's property to be set.
 
value:* — The property's value.
 
spread:* (default = 0) — The spread of the value. If this is anything besides '0', a random value will be generated using the value and spread.
 
precision:int (default = 0) — The amount of decimal points used when creating a spread value
 
extras:Object (default = null) — An 'extras' object to be passed to the tween engine for that keyframe.

Returns
ParticleTweenController
addColorTween()method 
public function addColorTween(property:String = color, duration:Number = 0):ParticleTweenController

This creates a ParticleTweenController that is specific for color tweening. This can be used to tween other properties on the particle that are color variables, like a fill or 3D object.

For a standard color tween on a display object, use the property 'color'. Any other value will assume it's a special property on the particle.

Parameters

property:String (default = color) — The particle's property to be set for color. The standard property should be 'color'.
 
duration:Number (default = 0) — The entire duration for the controller. If this is 0 (default), the duration will be set to the particle's life.

Returns
ParticleTweenController
addPhysics()method 
public function addPhysics(property:String, duration:Number = 0, flip:Boolean = false, useAngle:Boolean = true):ParticlePhysicsController

This creates a ParticlePhysicsController (which is like a PhysicsMultiController) that has 3 ParticleTweenControllers for each physics property: velocity, acceleration, and friction.

Parameters

property:String — The particle's property to be set.
 
duration:Number (default = 0) — The entire duration for the controller. If this is 0 (default), the duration will be set to the particle's life.
 
flip:Boolean (default = false) — To set the physics's object flip value. This is useful for some properties like 'y'.
 
useAngle:Boolean (default = true) — To use the emitter's angle value for the physics object. Set to false for properties besides x,y,z

Returns
ParticlePhysicsController
addTween()method 
public function addTween(property:String, duration:Number = 0):ParticleTweenController

This creates a ParticleTweenController for the given property. Each particle created will have this MotionController generated for it.

Parameters

property:String — The particle's property to be set.
 
duration:Number (default = 0) — The entire duration for the controller. If this is 0 (default), the duration will be set to the particle's life.

Returns
ParticleTweenController
fromXML()method 
public function fromXML(xml:XML):ParticleController

This configures the ParticleController from XML and creates all child controllers.

Parameters

xml:XML — The XML object used to configure the ParticleController.

Returns
ParticleController — The ParticleController object (for chaining)
toXML()method 
public function toXML():XML

Creates an XML object containing configuration for the ParticleController

Returns
XML — An XML object representing the ParticleController