polyGeek.com
polyGeek.com
polyGeek.com

Particles - API

January 19th, 2008 . by polyGeek

Read the introduction to the Particles class here.
Download Class files

setDustPerSec( countSec:Number )
Set the rate at which dust MovieClips are created. Initially the FramePerSecond is set at 33. So that is the maximum number of dust MovieClips that can be created per second. If you increase the FramePerSecond - with setFPS( n:Number), see below - then you can increase the dust per second up to that same rate.

turnDustOff()
Stops the production of dust.

taperDustRate( sec:Number, countSec:Number ):
Change the rate of dust production over a period of time. This means you can fade the dust production up or down. It’s important to remember that this changes the rate from it’s current value. When you initially create an instance of FairyDust the rate of production is 0. So if you try to fade to 0 over a period of time nothing will happen. You first have to set the rate of production using setDustPerSec() and then fade with taperDustRate().

setFPS( n:Number )
Set the FramesPerSecond. FairyDust uses an interval, not an onEnterFrame. So you can change the speed that it runs internally.

momentumBit( b:Boolean )
By default this is false. If you switch it to true and if the source(s) are moving then the dust MovieClips will inherit the momentum of the source(s).

setAlphaThreshold( n:Number )
When the _alpha of a dust MovieClip passes below this value it is deleted. By default it is set to 10.

setAlphaDelta( n:Number )
The rate at which the _alpha changes over time. By default it is set at 2.

moveSourceWithClip( mc:MovieClip )
If you would like for the source(s) to move automatically in relation to another MovieClip then use this. Just pass a reference to the MovieClip that you want the source(s) to follow.

setDustScale( n:Number )
Change the scale of the dust MovieClips when they are created.

setXYFriction( xValue:Number, yValue:Number )
Dampens the momentum and gravity effects. For instance, if something is moving horizontally there is no built in way to change it’s speed. If the xValue were to be < 1 then the movement along the x-axis would slow down as a piece of dust moves. On the other hand if the xValue were to be > 1 then the dust would speed up over time.

setSpin( low:Number, high:Number )
How much, and in what directio, the individual particles can spin. This will be a random number between the two arguments.

Share and Enjoy:
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • Digg
  • Facebook
  • Slashdot

similar posts

One Response to “Particles - API”


  1. [...] else. And the MovieClips don’t have to fall. They can also float up. ( Download class files ) ( API documentation [...]

   Welcome back (Change)

Leave a Reply

comment feed RSS  subscribe to this comment thread

Recent Posts

   




© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
Ajax CommentLuv Enabled 816cf46662e57ab1b89821d8e1e32a6b
M2 Websites