title: My drawRoundRect is not drawing a rounded rectangle :( [Flash]
body: <p>I just wrote a Background class for a new project. The background is basically going to be 2 rounded rectangles with a simple stroke and fill color laid on top of each other.</p>
  
  <p>Anyways right now I'm just trying to draw out 1 rounded rectangle, but for some reason I don't see it anywhere on stage :( No errors and my traces trace out correctly. <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Shape.html" rel="nofollow noreferrer">This is the example</a> I've been following. I've also included the code from my Document class which draws the Background.</p>
  
  <h2>Background.as</h2>
  
  <pre><code>package src.display{
  
  import flash.display.DisplayObject;
  import flash.display.Graphics;
  import flash.display.JointStyle;
  import flash.display.LineScaleMode;
  import flash.display.Shape;
  import flash.display.Sprite;
  import flash.events.Event;
  
  public class Background extends Sprite {
  
      private const position:Number = 0;
  
      private var child:Shape       = new Shape();
      private var bgColor:uint      = 0xE8E7E7;
      private var borderColor:uint  = 0xCCCCCC;
      private var borderSize:uint   = 1;
      private var cornerRadius:uint = 3;
      private var sizeW:uint;
      private var sizeH:uint;
  
      public function Background():void {
          if (stage) {
              init();
          } else {
              addEventListener(Event.ADDED_TO_STAGE, init);
          }
      }
  
      private function init(e:Event = null):void {
          removeEventListener(Event.ADDED_TO_STAGE, init);
      }
  
      public function draw(w, h):void {
          sizeW=w; //w &amp; h are passed from Document class
          sizeH=h;
  
          child.graphics.beginFill(bgColor);
          child.graphics.lineStyle(borderSize, borderColor);
          child.graphics.drawRoundRect(position, position, sizeW-1, sizeH-1, cornerRadius);
          child.graphics.endFill();
  
          addChild(child);
  
          trace("child.x = "+child.x);
          trace("child.x = "+child.y);
          trace("child.w = "+child.width);
          trace("child.h = "+child.height);
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My traces all come out correctly:</p>
  
  <pre><code>child.x = 0
  child.x = 0
  child.w = 520
  child.h = 510
  </code></pre>
  
  <p><strong>Here is the code from my Document class which inits the Background class:</strong></p>
  
  <pre><code>private function drawBackground():void
      {
          trace("\r"+"drawBackground called");
  
          bg = new Background();
          bg.draw(globalWidth, globalHeight);
  
          trace("drawBackground end");
      }
  </code></pre>