波っぽい2
// forked from beatspace's 波っぽい
package {
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
[SWF(backgroundColor="0x000000")]
public class test extends Sprite
{
private var base:Sprite = new Sprite();
private var i:Number = 0;
private var r:Number = 100;
private var x_pos:Number = 0;
private var a:Number = 0;
public function test()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//base.x = stage.stageWidth / 2;
base.y = 200;
addChild(base);
var timer:Timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, loop);
timer.start();
//addEventListener(Event.ENTER_FRAME, loop);
}
public function loop(evt:Event):void {
base.graphics.clear();
var w:Number = 100 * Math.sin(a * Math.PI / 180);
for (var i:Number = 0; i < 150; i += 4) {
var rad:Number = (i + w) * Math.PI / 180;
var sin:Number = r * Math.sin(rad);
var cos:Number = r * Math.cos(rad);
base.graphics.lineStyle(2, 0xffff0f);
base.graphics.beginFill(0xffffff);
base.graphics.drawCircle(x_pos, sin, 5);
base.graphics.endFill();
//i += 3;
x_pos += 15;
}
x_pos = 0;
a++;
}
}
}