/**
* Copyright greentec ( http://wonderfl.net/user/greentec )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/edvk
*/
package {
import flash.display.Sprite;
public class FlashTest extends Sprite {
public var n:int = 200;
public var seedSizeConstant:Number = 0.1;
public var xPos:int = stage.stageWidth / 2;
public var yPos:int = stage.stageHeight / 2;
public var phi:Number = (1 + Math.sqrt(5)) / 2; //fibonacci
public var phiAngle:Number = Math.PI * 2 * phi;
public var radialFactor:Number = 1.1;
public function FlashTest() {
// write as3 code here..
var r:Number;
var a:Number;
var x:Number;
var y:Number;
var srad:Number;
//graphics.lineStyle(0, 0x000000, 1);
//graphics.beginFill(0xffdd55);
graphics.moveTo(xPos, yPos);
for (var i:int = 1; i < n; i += 1)
{
r = i * radialFactor;
a = i * phiAngle;
x = xPos + r * Math.cos(a);
y = yPos + r * Math.sin(a);
srad = i * seedSizeConstant;
graphics.lineStyle(0,0xff0000, (n-i)/n);
graphics.lineTo(x,y);
graphics.lineStyle(0,0x000000, 1);
graphics.beginFill(0xffdd55);
graphics.drawCircle(x, y, srad);
graphics.endFill();
}
}
}
}