I made two versions. One regular and one rainbow.
Let me know which one you like better, because I can’t decide.
The rainbow code is the same as this one, but with different color settings.
EDIT: This code should be legal.
this.headA = new Array();
this.drawCircle = function(col,siz,x,y,d) {
this.createEmptyMovieClip("c"+d,d)._x = x;
this["c"+d]._y = y;
this["c"+d].lineStyle(siz,col,100);
this["c"+d].lineTo(1,0);
return this["c"+d];
}
this.removeParticle = function(n,ind) {
n.removeMovieClip();
this.headA.splice(ind,1);
}
this.onEnterFrame = function() {
for (i in this.headA) {
this.headA*[0]._x += (this.headA*[5]!="head2") ? this.headA*[3]:(this.headA*[1]-this.headA*[0]._x)/8;
this.headA*[0]._y += (this.headA*[5]!="head2") ? this.headA*[4]:(this.headA*[2]-this.headA*[0]._y)/8;
this.headA*[0]._xscale = this.headA*[0]._yscale = (80+random(70)-35);
this.headA*[2] += (this.headA*[5]=="head2") ? 2:0;
col = new Color(this.headA*[0]).setRGB("0xFFFF"+((random(2)==0) ? "FF":((random(2)==0) ? "CC":"99")));
if (this.headA*[5] == "head" and (this.headA*[0]._x-this.headA*[1])*(this.headA*[0]._x-this.headA*[1])+(this.headA*[0]._y-this.headA*[2])*(this.headA*[0]._y-this.headA*[2])<100) {
for(j=0; j<16; j++) {
this.headA.push([this.drawCircle("0xFFFFFF",5,this.headA*[0]._x,this.headA*[0]._y,this.d++),this.headA*[0]._x+((j<8) ? (random(20)+100):(random(10)+55))*Math.cos(j*Math.PI/4+Math.random()*Math.PI/8),this.headA*[0]._y+((j<8) ? (random(20)+100):(random(10)+55))*Math.sin(j*Math.PI/4+Math.random()*Math.PI/8),0,0,"head2"]);
}
this.removeParticle(this.headA*[0],i);
} else if (this.headA*[5] == "head2" and this.headA*[0].clicks++>20+random(15)) {
this.removeParticle(this.headA*[0],i);
} else if (this.headA*[5] == "trail" and this.headA*[2]-this.headA*[0]._y<2) {
this.removeParticle(this.headA*[0],i);
}
(this.headA*[5]!="trail" and random(2)==0) ? this.headA.push([this.drawCircle("0xFFFFFF",2,this.headA*[0]._x+random(8)-4,this.headA*[0]._y+random(8)-4,this.d++),this.headA*[0]._x,this.headA*[0]._y+random(20)+5,0,1,"trail"]):0;
}
}
this.onMouseDown = function() {
this.tempx = random(400);
this.headA.push([this.drawCircle("0xFFFFFF",5,this.tempx,415,this.d++),this._xmouse,this._ymouse,7*Math.cos(Math.atan2(this._ymouse-415,this._xmouse-this.tempx)),7*Math.sin(Math.atan2(this._ymouse-415,this._xmouse-this.tempx)),"head"]);
}
*NOTE: Do not click too many times. I recommend having 2 fireworks onscreen at one time.
http://dounanthebarb.tripod.com/Kirupa25LineContest/cdb25LineEntry1Fireworks.html
http://dounanthebarb.tripod.com/Kirupa25LineContest/cdb25LineEntry1RbFireworks.html
NOTE 2***
Do NOT view the swf file below. For some strange reason, the particles are not removed. The html files are working correctly though.