var radius:int=100;
var numPoints:Number=30;
var points:Array=new Array();
var pre_r:Number=Math.PI*0.001;
var centX:Number=stage.stageWidth*0.5;
var centY:Number=stage.stageHeight*0.5;
var myTimer:Timer=new Timer(10,0);
myTimer.addEventListener(TimerEvent.TIMER,myTimer_timer_handler);
myTimer.start();
var fff=Math.round(Math.random()*1000000).toString(10);
var gf:GlowFilter=new GlowFilter();
gf.blurX=gf.blurY=10;
gf.color=0x3399ff + parseInt(fff,16);
this.filters=[gf] ;
var radians:Number=0;
var color:Number=0x3399ff +parseInt(fff,16);
function myTimer_timer_handler(e:Event) {
test();
}
function test() {
graphics.clear();
points=[] ;
radians+=pre_r
;
for (var i:Number=1; i<numPoints; i+=1) {
var fff=Math.round(Math.random()*1000000).toString(10);
var color:Number=0x3399ff +parseInt(fff,16);
var p:Point=new Point();
p.x=centX+Math.cos(radians*i)*radius ;
p.y=centY+Math.sin(radians*i)*radius ;
points.push(p);
}
graphics.lineStyle(Math.round(Math.random()*5),color,Math.random());
graphics.moveTo(centX,centY);
for (i=2; i<numPoints-2; i+=1) {
graphics.curveTo(points[i-1].x,points[i-1].y,points[i].x,points[i].y);
graphics.curveTo(points[i+1].x,points[i+1].y,centX,centY);
}
}
截取动画的5张图片
[img]http://dl.iteye.com/upload/attachment/151657/01831a65-ee19-393f-9497-d62f98c2924c.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/151660/97b01a39-5934-3791-8e15-53eaf3debcb6.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/151658/40f1e338-ceeb-3ebf-b472-61ac7bfdc753.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/151662/f97ab960-2c43-3bcf-ba89-0fdbbacc5fbf.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/151665/379de225-35d7-357a-bbca-aa2a5476666b.jpg[/img]