Drawing Circles : graphics « Graphics « Flash / Flex / ActionScript






Drawing Circles

 

package{
    import flash.display.Sprite;
    import flash.display.Shape;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    public class Main extends Sprite
    {
        private var Maib:Shape;

        public function ShapeTest()
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;

            stage.align = StageAlign.TOP_LEFT;
            var shape:Shape = new Shape();
            addChild(shape);
            shape.x = 100;
            shape.y = 100;
            shape.graphics.beginFill(0x000000, 1);
            shape.graphics.drawCircle(0, 0, 100);
            shape.graphics.endFill();
        }
    }
}

        








Related examples in the same category

1.Introducing the Graphics Object
2.Creating Fills
3.Drawing Rounded Rectangles
4.Draw lines
5.Use the graphics
6.Change line style
7.Change scaleX
8.Set Shape position
9.Draw three shapes
10.Draw four shapes
11.Moving the Pen without Drawing
12.Drawing a Straight Line
13.Drawing a Curve
14.Adding a Simple One-Color Fill
15.To move the drawing pen without drawing any line at all, use moveTo( ).
16.To remove all vector drawings in an object, we use the Graphics class's instance method clear( ).
17.Drawing Lines in a Graphics Object