flash

by yun
♥0 | Line 46 | Modified 2010-06-09 16:35:05 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.MovieClip;
    public class Index extends MovieClip {
    		public function Index() {
    			var myCircle01:DrawCircle = new DrawCircle();
    			var myCircle02:DrawCircle = new DrawCircle();
    			var myCircle03:DrawCircle = new DrawCircle();
    			myCircle01.x = 100;
    			myCircle02.y = 100;
    			myCircle03.y = 200;
    			addChild(myCircle01);
    			addChild(myCircle02);
    			addChild(myCircle03);
    			//removeChild(myCircle03)
    		}
    }
}
import flash.display.MovieClip;
class DrawCircle extends MovieClip {
	public function DrawCircle() {
		var centerX:Number = 50;
		var centerY:Number = 50;
		var r:Number = 50;
					
    		graphics.lineStyle(1, 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);
    }
}

Forked