ConvolutionFilter Demo : ConvolutionFilter « Graphics « Flash / Flex / ActionScript






ConvolutionFilter Demo

 
package{
  import flash.display.Sprite;
  import flash.filters.*;
  public class Main extends Sprite{
    public function Main(){
        var box:Sprite = new Sprite(  );
        box.graphics.lineStyle(  );
        box.graphics.beginFill(0xFFFFFF);
        box.graphics.drawRect(0, 0, 100, 100);
        box.graphics.endFill(  );
        var boxShadow:Sprite = new Sprite(  );
        boxShadow.graphics.lineStyle(  );
        boxShadow.graphics.beginFill(0xFFFFFF);
        boxShadow.graphics.drawRect(0, 0, 100, 100);
        boxShadow.graphics.endFill(  );
        addChild(boxShadow);
        addChild(box);
        box.filters = [new GlowFilter(  )];
        boxShadow.filters = [new ConvolutionFilter(3, 3, [0, 0, 0, 0, 1, 0, 0, 0, 0])];
    }
  }
}

        








Related examples in the same category