One of the most common effects used in particle animations is particle "ghosting"; that is, having each particle leave a fading out, shadowy trail. In this tutorial we show how to accomplish this effect in a context as simple as possible.
Download the well-commented source file (Flash CS4) corresponding to the applet above, GhostingEffect.fla.
In several of our particle animations, we have used variations on a specific technique for creating the fading and ghostly trails behind the particles as they move around. These animations include among others:
- 'Nova' - Interactive Particle Effect in Flash
- A Dynamic Interactive Fountain - Flash CS4 AS3 Flash Particle Effect
- Waterfall Flash Effect - A Custom AS3 Waterfall Class
- Rain Animation with Splashing Raindrops - AS3 Effect
The technique of ghosting becomes becomes crystal clear if you download the 'fla' file from the link above and look at the simple Timeline code and the comments within the code. The effect is not difficult to achieve, but the complexity of our earlier particle examples may make it difficult to find the relevant code. We present here a very simple example of a single animated particle, with all code contained in a single fla file.
In short, the effect is created through the use of a bitmap which serves as the main display. The particle sprites are never shown on the stage; instead, on each frame, they are drawn to the bitmap. Also, the old picture is never erased; instead, we apply a BlurFilter and perhaps also a ColorTransform which together fade out the older pictures as the newer frames are drawn on top.