Packageorg.flintparticles.actions
Classpublic class ApproachNeighbours
InheritanceApproachNeighbours Inheritance Action

The ApproachNeighbours action applies an acceleration to the particle to draw it towards other nearby particles.



Public Properties
 PropertyDefined by
  acceleration : Number
The acceleration force applied to approach the other particles.
ApproachNeighbours
  maxDistance : Number
The maximum distance, in pixels, over which this action operates.
ApproachNeighbours
Public Methods
 MethodDefined by
  
ApproachNeighbours(maxDistance:Number, acceleration:Number)
The constructor creates a ApproachNeighbours action for use by an emitter.
ApproachNeighbours
  
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Action is added to it It is called within the emitter's addAction method and need not be called by the user.
ApproachNeighbours
  
The getDefaultPriority method is used to order the execution of actions.
ApproachNeighbours
 Inherited
The removedFromEmitter method is called by the emitter when the Action is removed from it It is called within the emitter's removeAction method and need not be called by the user.
Action
  
update(emitter:Emitter, particle:Particle, time:Number):void
The update method is used by the emitter to apply the action to every particle.
ApproachNeighbours
Property detail
accelerationproperty
acceleration:Number  [read-write]

The acceleration force applied to approach the other particles.

Implementation
    public function get acceleration():Number
    public function set acceleration(value:Number):void
maxDistanceproperty 
maxDistance:Number  [read-write]

The maximum distance, in pixels, over which this action operates. The particle will approach other particles that are this close or closer to it.

Implementation
    public function get maxDistance():Number
    public function set maxDistance(value:Number):void
Constructor detail
ApproachNeighbours()constructor
public function ApproachNeighbours(maxDistance:Number, acceleration:Number)

The constructor creates a ApproachNeighbours action for use by an emitter. To add a ApproachNeighbours to all particles created by an emitter, use the emitter's addAction method.

Parameters
maxDistance:Number — The maximum distance, in pixels, over which this action operates. The particle will approach other particles that are this close or closer to it.
 
acceleration:Number — The acceleration force applied to approach the other particles.

See also

Method detail
addedToEmitter()method
public override function addedToEmitter(emitter:Emitter):void

The addedToEmitter method is called by the emitter when the Action is added to it It is called within the emitter's addAction method and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that the Action was added to.
getDefaultPriority()method 
public override function getDefaultPriority():Number

The getDefaultPriority method is used to order the execution of actions. It is called within the emitter's addAction method when the user doesn't manually set a priority. It need not be called directly by the user.

Returns
Number
update()method 
public override function update(emitter:Emitter, particle:Particle, time:Number):void

The update method is used by the emitter to apply the action to every particle. It is called within the emitter's update loop and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.