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.

The angle value represents the angle of the theoretical light source falling on the object. The<br />

value determines the angle at which the gradient colors are applied to the object: where the<br />

highlight <strong>and</strong> the shadow appear, or where the first color in the array appears. The colors are<br />

then applied in the order in which they appear in the array.<br />

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

Example<br />

The following example demonstrates how to set the angle property on an existing object.<br />

import flash.filters.GradientBevelFilter;<br />

var mc:MovieClip = setUpFilter("angleExample");<br />

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

var arr:Array = this.filters;<br />

arr[0].angle = 45;<br />

this.filters = arr;<br />

}<br />

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

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

this.getNextHighestDepth());<br />

var w:Number = 150;<br />

var h:Number = 150;<br />

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

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

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

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

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

}<br />

var colors:Array = [0xFFFFFF, 0xCCCCCC, 0x000000];<br />

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

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

var filter:GradientBevelFilter = new GradientBevelFilter(5, 225, colors,<br />

alphas, ratios, 5, 5, 5, 3, "inner", false);<br />

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

return art;<br />

See also<br />

ratios (GradientBevelFilter.ratios property)<br />

626 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!