package { import flash.display.Shape; import flash.filters.BevelFilter; [SWF(width=550, height=400, backgroundColor=0xEEEEEE)] /** * Tests application of the BevelFilter to two rectangle shapes. */ public class graphic_flex_image_effects_02_Flex_BevelFilterTest extends graphic_flex_image_effects_02_Flex_BitmapFilterTest { /** * Applies bitmap filter to rectangle shape and textfield. */ override protected function applyFilter():void { var filter:BevelFilter = new BevelFilter(10); filter.highlightAlpha = .5; filter.shadowAlpha = .5; filter.blurX = 15; filter.blurY = 15; filter.strength = 80; _shape.filters = [filter]; // draws second shape to inset within outer rectangle var shape:Shape = new Shape(); shape.graphics.beginFill(0x004444); shape.graphics.drawRect(-50, -50, 100, 100); shape.graphics.endFill(); shape.x = stage.stageWidth/2; shape.y = stage.stageHeight/2; // reverses the light direction, making the shape appear inset filter.distance = 5; filter.angle = 225; filter.strength = 1; shape.filters = [filter]; addChild(shape); } } }