【wonderfl本】class Array
/**
* Copyright Knuckle ( http://wonderfl.net/user/Knuckle )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/mDj0
*/
// forked from dev_knuckle's class
package {
import flash.display.MovieClip;
public class Index extends MovieClip {
public function Index() {
var xList:Array = [100, 200, 150, 80, 190];
var yList:Array = [100, 100, 10, 230, 130];
var rList:Array = [10, 20, 40, 80, 160];
for(var k:uint= 0; k < xList.length; k++ ){
var circle:DrawCircle = new DrawCircle(xList[k],yList[k],rList[k]);
addChild(circle);
}
}
}
}
import flash.display.MovieClip;
class DrawCircle extends MovieClip {
public function DrawCircle(centerX:Number, centerY:Number, r:Number) {
graphics.lineStyle(2, 0x000000);
graphics.moveTo(centerX+r, centerY);
graphics.curveTo(r+centerX, Math.tan(Math.PI/8)*r+centerY, Math.sin(Math.PI/4)*r+centerX,
Math.sin(Math.PI/4)*r+centerY);
graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, r+centerY, centerX, r+centerY);
graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, r+centerY, -Math.sin(Math.PI/4)*r+centerX,
Math.sin(Math.PI/4)*r+centerY);
graphics.curveTo(-r+centerX, Math.tan(Math.PI/8)*r+centerY, -r+centerX, centerY);
graphics.curveTo(-r+centerX, -Math.tan(Math.PI/8)*r+centerY, -Math.sin(Math.PI/4)*r+centerX,
-Math.sin(Math.PI/4)*r+centerY);
graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, -r+centerY, centerX, -r+centerY);
graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, -r+centerY, Math.sin(Math.PI/4)*r+centerX,
-Math.sin(Math.PI/4)*r+centerY);
graphics.curveTo(r+centerX, -Math.tan(Math.PI/8)*r+centerY, r+centerX, centerY);
}
}