Rotating Stars

Just a quick little thing that I was playing with it. It’s very short indeed.

Mouse controls rotation speed along x-axis and alpha on y-axis.

Stage.scaleMode = "noScale";

var cols:Array = [0xC2F44D, 0xB0E84B, 0x9FDC49, 0x8DD047, 0x7BC445, 0x6AB843, 0x58AC41, 0x47A03F, 0x35943D, 0x23883B, 0x127C39, 0x007037];

var stars:Array = [_root.createEmptyMovieClip("star_1", _root.getNextHighestDepth())];
	star_1.i = 0;
	star_1._x = 275;
	star_1._y = 200;
	star_1.lineStyle(0, 0, 0);
	star_1.beginFill(cols[0], 100);
	star_1.moveTo(0, 15);
	
for (a=0, r=15; a<=Math.PI*2; a+=Math.PI*0.2, r = 12+(12-r)) {
	star_1.lineTo(Math.cos(a)*r, Math.sin(a)*r);
}

for (i=1; i<10; i++) {
	stars.push(_root.star_1.duplicateMovieClip("star_"+i, -i));
	new Color(_root["star_"+i]).setRGB(cols[i%cols.length]);
	_root["star_"+i].i = i;
	_root["star_"+i]._xscale =_root["star_"+i]._yscale = (i+1)*100;
}

function onEnterFrame() {
	for (i in stars) {
		stars*._rotation += (stars*.i+1)*(_xmouse-275)*0.005;
		stars*._alpha = 250 - Math.abs(_ymouse-200)*stars*.i*0.5;
	}
}