528
ActionScript classes
function createGradientBitmap(w:Number, h:Number, bgColor:Number,
type:String, hide:Boolean):BitmapData {
var mc:MovieClip = this.createEmptyMovieClip("mc", 1);
var matrix:Matrix = new Matrix();
matrix.createGradientBox(w, h, 0, 0, 0);
mc.beginGradientFill(type, [0xFF0000, 0x0000FF], [100, 100], [0x55,
0x99], matrix, "pad");
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.lineTo(0, 0);
mc.endFill();
(hide == true) ? mc._alpha = 0 : mc._alpha = 100;
var bmp:BitmapData = new BitmapData(w, h, true, bgColor);
bmp.draw(mc, new Matrix(), new ColorTransform(), "normal",
bmp.rectangle, true);
mc.attachBitmap(bmp, this.getNextHighestDepth());
return bmp;
}
function createTextBlock():MovieClip {
var txtBlock:MovieClip = this.createEmptyMovieClip("txtBlock",
this.getNextHighestDepth());
txtBlock.createTextField("txt", this.getNextHighestDepth(), 0, 0, 300,
80);
txtBlock.txt.text = "watch the text bend with the displacement map";
return txtBlock;
}
DropShadowFilter
(flash.filters.DropShadowFilter)
Object
|
+-flash.filters.BitmapFilter
|
+-flash.filters.DropShadowFilter
public class
DropShadowFilter
extends BitmapFilter
The DropShadowFilter class lets you add a drop shadow to a variety of objects in Flash. You
have several options for the style of the drop shadow, including inner or outer shadow and
knockout mode.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...