# Flash Star Particle Illusion by Virusescu

**URL:** <https://forum.kirupa.com/t/flash-star-particle-illusion-by-virusescu/175315>\
**Category:** contests\
**Created:** [January 13, 2006, 11:21am UTC](https://forum.kirupa.com/t/flash-star-particle-illusion-by-virusescu/175315 "2006-01-13T11:21:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![virusescu](https://avatars.discourse-cdn.com/v4/letter/v/8edcca/32.png) [@virusescu](https://forum.kirupa.com/u/virusescu)\
**Post date:** [January 13, 2006, 11:21am UTC](https://forum.kirupa.com/t/flash-star-particle-illusion-by-virusescu/175315/1 "2006-01-13T11:21:06Z")

</div>

Hello there fellow flashers. Here’s my second entry for this fine and fun contest.

```auto

Stage.scaleMode = "noScale";
function onEnterFrame() {
	newShape = this.createEmptyMovieClip("shape"+t, t);
	newShape.vars = {born:getTimer(),rotation:Math.random()*6.2831};
	drawShape(newShape, _xmouse,_ymouse, 15,7,8, t++);
	newShape.onEnterFrame = function () {
		this._x += Math.cos(this.vars.rotation)*3;
		this._y += Math.sin(this.vars.rotation)*3;
		this._xscale = this._yscale = this._xscale - 2;
		getTimer() - this.vars.born > 1000 ? this.removeMovieClip() : null;
		var color = new Color(this);
		color.setRGB(newRgb(getTimer()-this.vars.born));
		this._rotation += 10;
                this._alpha *= 0.9
	}
}
function drawShape(mc, cx,cy, rmax,rmin, corners, rotation) {
	mc.lineStyle(0, 0xFFFFFF, 0, 0, 0, 0, 0, 0);
	mc.beginFill(newRgb(0),100);
	mc.moveTo(rmax,0);
	mc._x = cx;
	mc._y = cy;
	for (var x = 0; x<=6.283185; x += 6.283185/corners) {
		mc.lineTo(rmax*Math.cos(x),rmax*Math.sin(x));
		mc.lineTo(rmin*Math.cos(x+3.14/corners), rmin*Math.sin(x+3.14/corners));
	}
}
function newRgb(t) {
	return (255 << 16)+(Math.floor(t/5) << 8)+Math.floor(Math.abs(Math.min(_ymouse, 400))/400*255);
}
this.createEmptyMovieClip("shape", 10);
t = 10;

```
