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 createDropShadowRectangle(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 filter:DropShadowFilter = new DropShadowFilter(15, 45, 0x000000, 0.8,<br />

16, 16, 1, 3, false, false, false);<br />

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

filterArray.push(filter);<br />

art.filters = filterArray;<br />

return art;<br />

knockout (DropShadowFilter.knockout property)<br />

public knockout : Boolean<br />

Applies a knockout effect (true), which effectively makes the object's fill transparent <strong>and</strong><br />

reveals the background color of the document. The default is false (no knockout).<br />

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

Example<br />

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

clicks it.<br />

import flash.filters.DropShadowFilter;<br />

var mc:MovieClip = createDropShadowRectangle("DropShadowKnockout");<br />

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

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

filter.knockout = true;<br />

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

}<br />

DropShadowFilter (flash.filters.DropShadowFilter) 549

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

Saved successfully!

Ooh no, something went wrong!