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.

strength (BevelFilter.strength property)<br />

public strength : Number<br />

The strength of the imprint or spread. Valid values are from 0 to 255. The larger the value,<br />

the more color is imprinted <strong>and</strong> the stronger the contrast between the bevel <strong>and</strong> the<br />

background. The default value is 1.<br />

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

Example<br />

The following example changes the strength property on the existing MovieClip instance<br />

(rect) when a user clicks it:<br />

import flash.filters.BevelFilter;<br />

var rect:MovieClip = createBevelRectangle("BevelStrength");<br />

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

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

filter.strength = 10;<br />

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

}<br />

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

var w:Number = 100;<br />

var h:Number = 100;<br />

var bgColor:Number = 0x00CC00;<br />

}<br />

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

this.getNextHighestDepth());<br />

rect.beginFill(bgColor);<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 />

var filter:BevelFilter = new BevelFilter(5, 45, 0xFFFF00, 0.8, 0x0000FF,<br />

0.8, 20, 20, 1, 3, "inner", false);<br />

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

return rect;<br />

296 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!