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
property if the
property is set to
mode
Availability: ActionScript 1.0; Flash Player 8
512
ActionScript classes
.
3, COLOR
is 0. Use this
color
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?