forked from: flash on 2010-2-7

by kazuyuki forked from flash on 2010-2-7 (diff: 26)
♥0 | Line 42 | Modified 2010-02-13 22:40:56 | MIT License
play

ActionScript3 source code

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

// forked from kazuyuki's flash on 2010-2-7
package {
	import flash.events.Event;
    import flash.display.MovieClip;
    public class FlashTest extends MovieClip {
        public function FlashTest() {
        		var myCircle1:DrawCircle = new DrawCircle();
        		var myCircle2:DrawCircle = new DrawCircle();
        		myCircle1.x = 100;
        		myCircle1.y = 200;
        		myCircle2.x = 300;
        		myCircle2.y = 200;
        		
        		addChild(myCircle1);
        		addChild(myCircle2);
        }
    }
} 
import flash.display.MovieClip;
class DrawCircle extends MovieClip{
	public function DrawCircle(){
    
            var centerX:Number = 0;
            var centerY:Number = 0;
            var r:Number =50;
            
            graphics.lineStyle(2,0x888888);
            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