512
ActionScript classes
var mapBitmap:BitmapData = createGradientBitmap(300, 80, 0xFF000000,
"radial", true);
var filter_1:DisplacementMapFilter = new DisplacementMapFilter(mapBitmap,
new Point(-30, -30), 1, 1, 10, 10, "wrap", 0x000000, 0x000000);
var filter_2:DisplacementMapFilter = filter_1;
var clonedFilter:DisplacementMapFilter = filter_1.clone();
trace(filter_1.mode); // wrap
trace(filter_2.mode); // wrap
trace(clonedFilter.mode); // wrap
filter_1.mode = "ignore";
trace(filter_1.mode); // ignore
trace(filter_2.mode); // ignore
trace(clonedFilter.mode); // wrap
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;
}
color (DisplacementMapFilter.color property)
public color : Number
Specifies what color to use for out-of-bounds displacements. The valid range of displacements
is 0.0 to 1.0. Values are in hexadecimal format. The default value for
color
is 0. Use this
property if the
mode
property is set to
3, COLOR
.
Availability:
ActionScript 1.0; Flash Player 8
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...