03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BlurFilter constructor<br />

public BlurFilter([blurX:Number], [blurY:Number], [quality:Number])<br />

Initializes the filter with the specified parameters. The default values create a soft, unfocused<br />

image.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Parameters<br />

blurX:Number [optional] - The amount to blur horizontally. Valid values are from 0 to 255<br />

(floating-point value). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16<br />

<strong>and</strong> 32) are optimized to render more quickly than other values.<br />

blurY:Number [optional] - The amount to blur vertically. Valid values are from 0 to 255<br />

(floating-point value). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16<br />

<strong>and</strong> 32) are optimized to render more quickly than other values.<br />

quality:Number [optional] - The number of times to apply the filter. The default value is 1,<br />

which is equivalent to low quality. A value of 2 is medium quality, <strong>and</strong> a value of 3 is high<br />

quality <strong>and</strong> approximates a Gaussian blur.<br />

Example<br />

The following example instantiates a new BlurFilter constructor <strong>and</strong> applies it to a flat,<br />

rectangular shape:<br />

import flash.filters.BlurFilter;<br />

var rect:MovieClip = createRectangle(100, 100, 0x003366,<br />

"BlurFilterExample");<br />

var blurX:Number = 30;<br />

var blurY:Number = 30;<br />

var quality:Number = 3;<br />

var filter:BlurFilter = new BlurFilter(blurX, blurY, quality);<br />

var filterArray:Array = new Array();<br />

filterArray.push(filter);<br />

rect.filters = filterArray;<br />

344 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!