topical media & game development

talk show tell print

#graphic-flex-image-effects-02-Flex-BitmapFilterTest.ax

#graphic-flex-image-effects-02-Flex-BitmapFilterTest.ax [swf] [flash] flex


  package {
  
          import flash.display.Shape;
          import flash.display.Sprite;
  
          
Astract class for testing application of BitmapFilters to a rectangle shape.

  
          public class @ax-graphic-flex-image-effects-02-Flex-BitmapFilterTest extends Sprite {
  
                  protected var _shape:Shape;
  
                  
Constructor.

  
                  public function @ax-graphic-flex-image-effects-02-Flex-BitmapFilterTest() {
                          createShape();
                          applyFilter();
                  }
  
                  
Creates a rectangle shape with a solid fill in the center of the stage.

  
                  private function createShape():void {
                          var sideWidth:Number = 150;
                          _shape = new Shape();
                          _shape.graphics.beginFill(0x006666);
                          _shape.graphics.drawRect(-sideWidth/2, -sideWidth/2, sideWidth, sideWidth);
                          _shape.graphics.endFill();
                          _shape.x = stage.stageWidth/2;
                          _shape.y = stage.stageHeight/2;
                          addChild(_shape);
                  }
  
                  
Abstract method to be overridden by child classes in order to apply a bitmap filter to the drawn shape.

  
                  protected function applyFilter():void {}
  
          }
  
  }


(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.