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.

Example<br />

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

import flash.filters.GradientBevelFilter;<br />

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

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

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

arr[0].quality = 1; // low quality<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 />

ratios (GradientBevelFilter.ratios property)<br />

public ratios : Array<br />

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

values for each element in the array 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 />

636 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!