/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static function circle(items:Array, center:Point, distance:Number = -1, initialAngle:Number = 0):void { var step:Number = (2* Math.PI) / items.length; var angle:Number = initialAngle; for each (var d:DisplayObject in items) { if (distance < 0) distance = d.height+10 / Math.sin(step); d.x = center.x + distance * Math.cos(angle); d.y = center.y + distance * Math.sin(angle); angle += step; } }
URL: http://www.nightdrops.com/2009/quickreference-display-elements-in-a-circle