In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Perfectly Round Circles

Get Adobe Flash player
by makc3d 28 Nov 2009
package  {
	import flash.display.Sprite;
	[SWF(width=465,height=465,backgroundColor='#cccccc')]
	public class PerfectlyRoundCircles extends Sprite {
		public function PerfectlyRoundCircles () {
			var d:int = 15;
			for (var r:int = 60; r < 0.5 * 465; r += 40) {
				var n:int = 2 * int (0.5 * (2 * Math.PI * r) / (1.4 * d));
				for (var i:int = 0; i < n; i++) {
					var s:Sprite = new Sprite;
					s.graphics.lineStyle (2, 0xFFFFFF * (i % 2));
					s.graphics.drawRect ( -0.5 * d, -0.5 * d, d, d);
					s.x = r * Math.cos (2 * Math.PI * i / n) + 0.5 * 465;
					s.y = r * Math.sin (2 * Math.PI * i / n) + 0.5 * 465;
					s.rotation = 360 * i / n + 15 * (1 - 2 * (int (r / 40) % 2));
					addChild (s);
				}
			}
		}
	}
}