topical media & game development

talk show tell print

animation-ch09-Box.ax

animation-ch09-Box.ax [swf] [flash] flex


  package {
          import flash.display.Sprite;
          
          public class @ax-animation-ch09-Box extends Sprite {
                  private var w:Number;
                  private var h:Number;
                  private var color:uint;
                  public var vx:Number = 0;
                  public var vy:Number = 0;
                  
                  public function @ax-animation-ch09-Box(width:Number=50, height:Number=50, color:uint=0xff0000) {
                          w = width;
                          h = height;
                          this.color = color;
                          init();
                  }
                  public function init():void {
                          graphics.beginFill(color);
                          graphics.drawRect(-w / 2, -h / 2, w, h);
                          graphics.endFill();
                  }
          }
  }


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.