Forked from: hirotrail's flash on 2011-4-21 diff:23 forked from: flash on 2011-4-21 クラス化 hirotrail forked:1favorite:0lines:39license : MIT License modified : 2011-04-23 01:01:44 Embed Tweet // forked from hirotrail's flash on 2011-4-21 package { import flash.display.MovieClip; public class index extends MovieClip { public function index() { // write as3 code here.. var myCircle1:DrawCircle = new DrawCircle(); var myCircle2:DrawCircle = new DrawCircle(); myCircle1.x = 50; myCircle2.y = 200; addChild(myCircle1); addChild(myCircle2); } } } import flash.display.MovieClip; class DrawCircle extends MovieClip { public function DrawCircle(){ var centerX:Number = 100; var centerY:Number = 200; var r:Number = 50; //左上がY=0なのねー忘れてた! graphics.lineStyle(2,0xff0006); graphics.moveTo(centerX+r,centerY); graphics.curveTo(r+centerX,Math.tan(Math.PI/8)*r+centerY, //a Math.sin(Math.PI/4)*r+centerX,Math.sin(Math.PI/4)*r+centerY); //a' graphics.curveTo(Math.tan(Math.PI/8)*r+centerX,r+centerY, //b centerX,r+centerY); //b' graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX,r+centerY, //c -Math.sin(Math.PI/4)*r+centerX,Math.sin(Math.PI/4)*r+centerY);//c' graphics.curveTo(-r+centerX,Math.tan(Math.PI/8)*r+centerY, //d -r+centerX,centerY);//d' graphics.curveTo(-r+centerX,-Math.tan(Math.PI/8)*r+centerY, //e -Math.sin(Math.PI/4)*r+centerX,-Math.sin(Math.PI/4)*r+centerY);//e' graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX,-r+centerY, //f centerX,-r+centerY);//f' graphics.curveTo(Math.tan(Math.PI/8)*r+centerX,-r+centerY, //g Math.sin(Math.PI/4)*r+centerX,-Math.sin(Math.PI/4)*r+centerY);//g' graphics.curveTo(r+centerX,-Math.tan(Math.PI/8)*r+centerY, //h r+centerX,centerY);//h' } } Code Fullscreen Preview Fullscreen class クラス Math.tan Math.PI Math.sin addChild MovieClip Number sort new page view favorite forked pv120 forked from: forked from: flas.. hirotrail forked:1 favorite:0lines:37 (diff:14)