forked from: wave01
/**
* Copyright keno42 ( http://wonderfl.net/user/keno42 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/azJ5
*/
// forked from syunki's wave01
package {
import flash.display.Sprite;
import flash.events.Event;
[SWF(width="465", height="465", backgroundColor="0x000000", frameRate="30")]
public class FlashTest extends Sprite {
private var time:int = 0;
private var pos:Array = [];
private const NUM:int = 150;
public function FlashTest() {
// write as3 code here..
Init();
}
private function Init():void {
time= 0;
addEventListener(Event.ENTER_FRAME, Draw);
for( var i:int = 0;i <= NUM ; i++ ){
pos.push([230,230]);
}
}
private function Draw(event:Event):void {
graphics.clear();
graphics.lineStyle(1, 0xFFFFFF);
pos[0]= [230 + Math.cos( time / 10) * 150, 230 + Math.sin(time / 10) * 150];
for (var i:int = 1; i <= NUM; i++) {
pos[i][0] += (1-(0.25+0.5*(i/NUM))) * (pos[i-1][0] - pos[i][0]);
pos[i][1] += (1-(0.25+0.5*(i/NUM))) * (pos[i-1][1] - pos[i][1]);
graphics.beginFill(0x00FFFF);
graphics.drawCircle(pos[i][0], pos[i][1], 1+5*(1-(i/NUM)));
graphics.endFill();
}
time++;
}
}
}