Logo firework

Flash required: You need version 9 or later of the free Flash player from Adobe to use this content. To download and install the free player from Adobe’s web site click here.

Source code

Because the initial velocity for particles is based on a zone, and because we can make zones from bitmap data objects and display objects, it's relatively easy to create effects like the one above. The initial velocity for the particles uses a zone derived from the logo image. Add a little gravity and blur and this is the result.

The example is created in a single document class as follows

package
{
  import flash.display.Bitmap;
  import flash.display.Sprite;
  import flash.filters.BlurFilter;
  import flash.filters.ColorMatrixFilter;
  import flash.geom.Point;
  import flash.geom.Rectangle;
  
  import org.flintparticles.actions.*;
  import org.flintparticles.counters.*;
  import org.flintparticles.emitters.Emitter;
  import org.flintparticles.energyEasing.Quadratic;
  import org.flintparticles.events.FlintEvent;
  import org.flintparticles.initializers.*;
  import org.flintparticles.renderers.*;
  import org.flintparticles.zones.*;  

  public class LogoFirework extends Sprite
  {
    [Embed(source="assets/flint.png")]
    public var Logo:Class;

    private var emitter:Emitter;

    public function LogoFirework()
    {
      emitter = new Emitter();

      emitter.counter = new Blast( 1500 );
      
      emitter.addInitializer( new ColorInit( 0xFFFF3300, 0xFFFFFF00 ) );
      emitter.addInitializer( new Lifetime( 6 ) );
      emitter.addInitializer( new Position( new DiscZone( new Point( 0, 0 ), 10 ) ) );
      var bitmap:Bitmap = new Logo();
      emitter.addInitializer( new Velocity( new BitmapDataZone( bitmap.bitmapData, -132, -300 ) ) );
      
      emitter.addAction( new Age( Quadratic.easeIn ) );
      emitter.addAction( new Fade( 1.0, 0 ) );
      emitter.addAction( new Move() );
      emitter.addAction( new LinearDrag( 0.5 ) );
      emitter.addAction( new Accelerate( 0, 70 ) );
      
      emitter.addEventListener( FlintEvent.EMITTER_EMPTY, restart );

      var renderer:PixelRenderer = new PixelRenderer( new Rectangle( 0, 0, 500, 300 ) );
      renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
      renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.96,0 ] ) );
      emitter.renderer = renderer;
      addChild( renderer );
      
      emitter.x = 250;
      emitter.y = 300;
      emitter.start( );
    }
    
    public function restart( ev:FlintEvent ):void
    {
      Emitter( ev.target ).start();
    }
  }
}

N.B. This example uses the embed meta-data tag as used by the Flex SDK. The Flash version, with the image embedded as a library asset, is available in the examples download.