MovieClip
847
Example
The following example applies a drop shadow to a movie clip instance. It then traces the value
of the
cacheAsBitmap
property which is set to
true
when a filter is applied.
import flash.filters.DropShadowFilter;
var container:MovieClip = setUpShape();
trace(container.cacheAsBitmap); // false
var dropShadow:DropShadowFilter = new DropShadowFilter(6, 45, 0x000000, 50,
5, 5, 1, 2, false, false, false);
container.filters = new Array(dropShadow);
trace(container.cacheAsBitmap); // true
function setUpShape():MovieClip {
var mc:MovieClip = this.createEmptyMovieClip("container",
this.getNextHighestDepth());
mc._x = 10;
mc._y = 10;
var w:Number = 50;
var h:Number = 50;
mc.beginFill(0xFFCC00);
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.lineTo(0, 0);
mc.endFill();
return mc;
}
See also
opaqueBackground (MovieClip.opaqueBackground property)
,
cacheAsBitmap
(MovieClip.cacheAsBitmap property)
clear (MovieClip.clear method)
public clear() : Void
Removes all the graphics created during runtime by using the movie clip draw methods,
including line styles specified with
MovieClip.lineStyle()
. Shapes and lines that are
manually drawn during authoring time (with the Flash drawing tools) are unaffected.
Availability:
ActionScript 1.0; Flash Player 6
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...