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.

}<br />

var filter:BlurFilter = new BlurFilter(30, 30, 2);<br />

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

filterArray.push(filter);<br />

rect.filters = filterArray;<br />

return rect;<br />

blurY (BlurFilter.blurY property)<br />

public blurY : Number<br />

The amount of vertical blur. Valid values are from 0 to 255 (floating point). The default value<br />

is 4. Values that are a power of 2 (such as 2, 4, 8, 16 <strong>and</strong> 32) are optimized to render more<br />

quickly than other values.<br />

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

Example<br />

The following example changes the blurY property on an existing MovieClip instance when a<br />

user clicks it.<br />

import flash.filters.BlurFilter;<br />

var mc:MovieClip = createBlurFilterRectangle("BlurFilterBlurY");<br />

mc.onRelease = function() {<br />

var filter:BlurFilter = this.filters[0];<br />

filter.blurY = 200;<br />

this.filters = new Array(filter);<br />

}<br />

function createBlurFilterRectangle(name:String):MovieClip {<br />

var rect:MovieClip = this.createEmptyMovieClip(name,<br />

this.getNextHighestDepth());<br />

var w:Number = 100;<br />

var h:Number = 100;<br />

rect.beginFill(0x003366);<br />

rect.lineTo(w, 0);<br />

rect.lineTo(w, h);<br />

rect.lineTo(0, h);<br />

rect.lineTo(0, 0);<br />

rect._x = 20;<br />

rect._y = 20;<br />

}<br />

var filter:BlurFilter = new BlurFilter(30, 30, 2);<br />

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

filterArray.push(filter);<br />

rect.filters = filterArray;<br />

return rect;<br />

346 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!