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 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 />

ratios (GradientGlowFilter.ratios property)<br />

public ratios : Array<br />

An array of color distribution ratios for the corresponding colors in the colors array. Valid<br />

values are 0 to 255.<br />

The ratios property cannot be changed by directly modifying its values. Instead, you must<br />

get a reference to ratios, make the change to the reference, <strong>and</strong> then set ratios to the<br />

reference.<br />

The colors, alphas, <strong>and</strong> ratios properties are all related. The first element in the colors<br />

array corresponds to the first element in the alphas array <strong>and</strong> in the ratios array, <strong>and</strong> so on.<br />

Think of the gradient glow filter as a glow that emanates from the center of the object (if the<br />

distance value is set to 0), with gradients that are stripes of color blending into each other.<br />

The first color in the colors array is the outermost color of the glow. The last color is the<br />

innermost color of the glow.<br />

GradientGlowFilter (flash.filters.GradientGlowFilter) 657

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

Saved successfully!

Ooh no, something went wrong!