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.

function createGlowFilterRectangle(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:GlowFilter = new GlowFilter(0x000000, 0.8, 16, 16, 1, 3,<br />

false, false);<br />

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

filterArray.push(filter);<br />

rect.filters = filterArray;<br />

return rect;<br />

blurY (GlowFilter.blurY property)<br />

public blurY : Number<br />

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

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

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 movie clip when a user<br />

clicks it.<br />

import flash.filters.GlowFilter;<br />

var mc:MovieClip = createGlowFilterRectangle("GlowFilterBlurY");<br />

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

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

filter.blurY = 20;<br />

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

}<br />

612 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!