PDA

View Full Version : Laser light show



Ben H
January 20th, 2006, 03:36 PM
This one's based on the code for shooting stars.



Stage.scaleMode = "exactFit";
showPerf = new Rectangle(0,0,550,400);
_root.scrollRect = showPerf;
objs = [createEmptyMovieClip(0,getNextHighestDepth())];
objs[0].va = [objs[0].lineStyle(0, 0, 0), objs[0].beginFill(0xFF3311, 100), objs[0].moveTo(0, 0)];
for (a=0, r=700; a<=Math.PI*2; a+=Math.PI*0.2, r = 12+(12-r)) {
objs[0].lineTo(Math.cos(a)*r, Math.sin(a)*r);
}
i=1;
onEnterFrame = function() {
objs[i] = objs[0].duplicateMovieClip(i,getNextHighestDepth());
objs[i].va = [_root.objs[0]._x = 680, _root.objs[0]._y = 471, objs[i].xspeed = random(20)+1-10, objs[i].yspeed = random(20)+1-10];
for (n=1; n<(i+1); n++) {
objs[n].vb = [objs[n]._alpha -= 5, objs[n]._height -= 1, objs[n]._width -= 1, objs[n]._x += objs[n].xspeed, objs[n]._y += objs[n].yspeed];
(objs[n]._alpha < 70) ? _root.bleh = [objs[n].removeMovieClip()] : null;
}
i++;
objs[0]._rotation += 5;
}


View in a small window and it will run faster.

-Ben

sed|thh
January 20th, 2006, 07:09 PM
this reminds me of the old metamorf windows screen saver :)

hybrid101
January 24th, 2006, 12:21 AM
looks very good! ^lol, i thought the same