Working with filters using ActionScript 515
3. Select Control > Test Movie to test the document.
The amount of horizontal and vertical blurring is calculated by the mouse pointer’s
current
_xmouse and _ymouse position. As you move the mouse pointer to the upper-left
corner of the Stage, the amount of horizontal and vertical blurring decreases. Conversely,
as the mouse pointer moves to the lower-right corner of the Stage, the amount of
horizontal and vertical blurring increases.
Creating gradient glows
The GradientGlowFilter class lets you create a gradient glow effect for a variety of objects in
Flash. A gradient glow is a realistic-looking glow with a color gradient that you can specify.
You can apply a gradient glow around the inner or outer edge of an object or on top of
an object.
For more information on this filter, see GradientBevelFilter
(flash.filters.GradientBevelFilter) in the ActionScript 2.0 Language Reference.
The following procedure uses the Drawing API to draw a square on the Stage, and then
applies a gradient glow filter to the shape. Clicking the square on the Stage increases the filter’s
strength, whereas moving the mouse pointer horizontally or vertically modifies the amount of
blurring along the x-axis or y-axis.