package { import flash.filters.BitmapFilterQuality; import flash.filters.GlowFilter; import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFormatAlign; [SWF(width=550, height=400, backgroundColor=0xEEEEEE)] /** * Tests application of the GlowFilter to a rectangle shape and a textfield. */ public class graphic_flex_image_effects_02_Flex_GlowFilterTest extends graphic_flex_image_effects_02_Flex_BitmapFilterTest { /** * Applies bitmap filter to rectangle shape and textfield. */ override protected function applyFilter():void { var filter:GlowFilter = new GlowFilter(0x000000); filter.blurX = 2; filter.blurY = 2; filter.strength = 255; filter.quality = BitmapFilterQuality.MEDIUM; filter.knockout = true; _shape.filters = [filter]; // creates a textfield to which to apply a glow var field:TextField = new TextField(); var textFormat:TextFormat = new TextFormat("Arial", 40); textFormat.align = TextFormatAlign.CENTER; field.multiline = true; field.defaultTextFormat = textFormat; field.text = "Glow\nFilter"; field.x = _shape.x - field.width/2; field.y = _shape.y - field.height/2; field.filters = [filter]; addChild(field); } } }