forked from: 【wonderfl本】class Array

by bradsedito forked from 【wonderfl本】class Array (diff: 13)
♥0 | Line 38 | Modified 2011-07-19 07:06:24 | MIT License
play

ActionScript3 source code

/**
 * Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/hKLy
 */

// forked from Knuckle's 【wonderfl本】class Array
// forked from dev_knuckle's class
package {
    import flash.display.*;   
    import flash.geom.*;

    public class Index extends MovieClip {
        public function Index() {
            var s:Sprite = new Sprite();
            var xList:Array = [100, 200, 300, 400, 500];
            var yList:Array = [100, 200, 300, 400, 500];
            var zList:Array = [100, 200, 300, 400, 500];
            var wList:Array = [0, 0, 0, 0, 0];
            var rList:Array = [100, 100, 100, 100, 100];
            
            for(var k:uint= 0; k < xList.length; k++ ){
                var circle:DrawCircle = new DrawCircle(xList[k],yList[k],zList[k],wList[k],rList[k]);
                addChild(circle);
            }
        }
    }
}
import flash.display.MovieClip;
class DrawCircle extends MovieClip {
        public function DrawCircle(centerX:Number, centerY:Number, centerZ:Number, w: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);
        }
}