title: AS3 Class Extending Sprite
body: <p>I am new to ActionScript so excuse me if this is a stupid question.  </p>
  
  <p>So, I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.  </p>
  
  <p>What the heck is going on?  When I view the livedocs I see that DisplayObject has width and height listed as public properties.  I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.</p>
  
  <pre><code>package  {
      import flash.display.*;
  
      public class ScrollBar extends Sprite {
          public function ScrollBar(width:Number, height:Number) {
              trace(width + "x" + height);
              this.width = width;
              this.height = height;
              trace(this.width + "x" + this.height);          
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>20x400
  0x0
  </code></pre>