forked from: forked from: flash on 2010-4-28
/**
* Copyright takenosin ( http://wonderfl.net/user/takenosin )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/uKUk
*/
// forked from takenosin's forked from: flash on 2010-4-28
// forked from takenosin's flash on 2010-4-28
package {
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var sp:Sprite = new Sprite();
addChild(sp);
var g = sp.graphics;
//直線の描画
g.lineStyle(2,0x000000);
g.moveTo(150,100);
g.lineTo(400,100);
g.lineTo(400,120);
g.lineTo(150,120);
g.lineStyle(4,0xFF0000);
g.moveTo(150,175);
g.lineTo(400,175);
//曲線の描画
g.lineStyle(2,0x0000FF);
g.moveTo(150,100);
g.curveTo(275,0,400,100);
g.moveTo(0,0);
//単色塗りの追加
var triangle:Sprite = new Sprite();
with (triangle.graphics){
lineStyle(0);
beginFill(0xFF9900,1);
moveTo(50,0);
lineTo(100,100);
lineTo(0,100);
lineTo(50,0);
endFill();
}
triangle.x = 50;
triangle.y = 250;
addChild(triangle);
//シェイプの描画
var shapes:Sprite = new Sprite();
var gr = shapes.graphics;
gr.lineStyle(6,0x0000FF,0.5);
gr.beginFill(0xFF0000);
gr.drawCircle(50,50,50);
gr.endFill;
gr.lineStyle();
gr.beginFill(0x0000FF,0.2);
gr.drawRect(125,0,100,100);
gr.endFill();
gr.beginFill(0x0000FF,0.5);
gr.drawRoundRect(250,0,100,100,50);
gr.endFill();
shapes.x = 150;
shapes.y = 250;
addChild(shapes);
}
}
}