Packagecv.orion.filters
Classpublic class TargetsSpringFilter
ImplementsIFilter

The TargetsSpringFilter causes particles to spring to multiple targets. Depending on the strength of the spring, the particle might fling past the target, or get stuck bouncing back and forth.


Example
There are two ways to apply the filter. The first way it so set it via the config object. The second way is to add it to the effectFilters array itself.
  import cv.Orion;
  import cv.orion.filters.TargetsSpringFilter;
  
  var tgf:TargetsSpringFilter = new TargetsSpringFilter();
  tsf.addTarget(mc1, 0.025);
  tsf.addTarget(mc2, 0.05);
  tsf.addTarget(mc3, 0.025);
  
  // First method
  var e:Orion = new Orion(linkageClass, null, {effectFilters:[tgf]});
  
  // Second method
  var e2:Orion = new Orion(linkageClass);
  e2.effectFilters.push(tgf);
  



Public Methods
 MethodDefined by
  
addTarget(target:*, springAmount:Number = 0.05, minDist:Number = 100):void
Adds a target for the particles to have a spring attraction to.
TargetsSpringFilter
  
applyFilter(particle:ParticleVO, target:Orion):void
Applies the specified filter to a particular particle.
TargetsSpringFilter
  
clearTargets():void
Removes all targets from the spring system, resetting it.
TargetsSpringFilter
  
removeTarget(target:* = null):void
Removes a target from the spring system.
TargetsSpringFilter
Method detail
addTarget()method
public function addTarget(target:*, springAmount:Number = 0.05, minDist:Number = 100):void

Adds a target for the particles to have a spring attraction to.

Parameters
target:* — The target to be added.
 
springAmount:Number (default = 0.05) — How strong the spring attraction should be for the specific target.
 
minDist:Number (default = 100) — minDist The minimum distance the particle must be from the mouse for the filter to take effect.
applyFilter()method 
public function applyFilter(particle:ParticleVO, target:Orion):void

Applies the specified filter to a particular particle.

Parameters
particle:ParticleVO — The individual particle.
 
target:Orion — The emitter associated with the particle.
clearTargets()method 
public function clearTargets():void

Removes all targets from the spring system, resetting it.

removeTarget()method 
public function removeTarget(target:* = null):void

Removes a target from the spring system.

Parameters
target:* (default = null) — The target that was added previously.