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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following example changes the angle property on an existing movie clip when a user<br />

clicks it.<br />

import flash.filters.GradientGlowFilter;<br />

var mc:MovieClip = createGradientGlowRectangle("GlowAngle");<br />

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

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

filter.distance = 50;<br />

filter.angle = 90;<br />

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

}<br />

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

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

this.getNextHighestDepth());<br />

var w:Number = 100;<br />

var h:Number = 100;<br />

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

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

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

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

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

art._x = 20;<br />

art._y = 20;<br />

}<br />

var colors:Array = [0xFFFFFF, 0xFF0000, 0xFFFF00, 0x00CCFF];<br />

var alphas:Array = [0, 1, 1, 1];<br />

var ratios:Array = [0, 63, 126, 255];<br />

var filter:GradientGlowFilter = new GradientGlowFilter(0, 45, colors,<br />

alphas, ratios, 55, 55, 2.5, 2, "outer", false);<br />

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

filterArray.push(filter);<br />

art.filters = filterArray;<br />

return art;<br />

blurX (GradientGlowFilter.blurX property)<br />

public blurX : Number<br />

The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or less means that the<br />

original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4,<br />

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

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

646 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!