木棉 forked from: Flower
2010-07-21 00:27:14
/**
* Copyright civet ( http://wonderfl.net/user/civet )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7PtT
*/
// forked from summerTree's Flower
// 2010-07-21 00:27:14
package
{
//author 夏天的树人
import flash.display.Sprite;
import flash.display.Shape;
import flash.filters.*;
import flash.geom.*;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.easing.*;
import org.libspark.betweenas3.tweens.ITween;
public class Main extends Sprite
{
private var pen:Shape=new Shape();
public function Main()
{
graphics.beginFill(0);
graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
graphics.endFill();
pen.x = int(stage.stageWidth*.5);
pen.y = int(stage.stageHeight*.5);
addChild(pen);
pen.filters=[new GlowFilter(0xffff00)];
BetweenAS3.to(this, {len:120}, 2, Expo.easeOut).play();
}
private function draw(len:Number):void
{
pen.graphics.clear();
pen.graphics.lineStyle(1,0xff0000);
var n:int=360;
while (n--) {
var point:Point=Point.polar(len,142*n);
pen.graphics.moveTo(0,0);
pen.graphics.curveTo(Math.cos(n*Math.PI/180)*100,Math.sin(n*Math.PI/180)*100,point.x,point.y);
}
}
private var _len:Number = 0;
public function set len(value:Number):void {
_len = value;
draw(_len);
}
public function get len():Number {
return _len;
}
}
}