# Drawing a Simple Shape in Class

**URL:** <https://forum.kirupa.com/t/drawing-a-simple-shape-in-class/298107>\
**Category:** flash\
**Created:** [October 13, 2009, 7:30pm UTC](https://forum.kirupa.com/t/drawing-a-simple-shape-in-class/298107 "2009-10-13T19:30:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raabi](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raabi](https://forum.kirupa.com/u/Raabi)\
**Post date:** [October 13, 2009, 7:30pm UTC](https://forum.kirupa.com/t/drawing-a-simple-shape-in-class/298107/1 "2009-10-13T19:30:32Z")

</div>

Hello, everybody

This is my first meeting with the Shapes; which don’t seem cooperating, at all. Following is the Class code:

```auto
package
{
     import flash.display.Shape;
     import flash.display.MovieClip;
 
     public class TestShape extends MovieClip
     {
          private var _centerX: int;
          private var _centerY: int;
          private var _radius: uint = 100;
          private var _thickness: uint = 5;
 
          public function TestShape(centerX: Number, centerY: Number, 
                                    radius: uint, thickness: uint): void
         {
              _centerX = centerX;
              _centerY = centerY;
              _radius = radius;
              _thickness = thickness;
              drawCircle();
         }
 
         function drawCircle(): void
        {
              graphics.lineStyle (_thickness, 0x000000);
              graphics.beginFill (0xFFFFFF);
              graphics.drawCircle(_centerX, _centerY, _radius);
             graphics.endFill(); 
        }  
     }
}

```

And following is my FLA code:

```auto
 
import TestShape;
var centerX: Number;
var centerY: Number;
var radius: uint = 100;
var thickness: uint = 5;
centerX = centerY = radius + 10;
var shape: TestShape = new TestShape(centerX, centerY, radius, thickness);
 

```

Would anybody let me know, how to convince my class to do the job, please!
