![]() |
![]() ![]() |
Each particle movie clip that gets created in the scene is dynamically given a set of properties which are updated on every frame while the particle is 'alive'. You can access these properties via ActionScript in the class or timeline for the particle movie clip. This gives you the ability to customize physics, or trigger events such as color changes for the movie clip as it moves through its life span. The Particulator component also calls functions on the particle movie clip when it is updated or removed.
Upon creation, each particle is given an object named pgenProps. If you are using ActionScript 3, you must either declare your particle class as dynamic, or make sure to already have a public pgenProps property on the class. The object is given the following properties:
age : current age of the particle in seconds.
alphaFadeStart : percentage value of life span when the particle will begin fading down the alpha.
initialAlpha : initial alpha applied to the particle (0-100).
lifeSpan : life span, or how long the particle will exist, in seconds.
rotVel : current rotation velocity in degrees per second.
t : a value from 0 - 1, which is simply age/lifeSpan.
vDepth : a value from 0.5 - 1 indicating an assigned depth for use in conjunction with the depthFactor property. Default is 1.
vx : current velocity along x-axis in pixels per second.
vy : current velocity along y-axis in pixels per second.
windSwirl : a value from -1 to 1 that determines whether the particle will flow with or against the wind.
The following functions are called on each particle with no arguments:
particleUpdated : called every time the component updates - once every frame.
particleRemoved : called when the particle is about to be removed from the stage.
For more information on particle properties (or any other questions), please visit the forum. Also check out the sample file ParticulatorSamples.fla that was included in the mxp install package.
![]() ![]() |
|