http://www.senocular.com/flash/source.php?id=0.172
senocular has created that displacement map using multiple layers of colours and alphas.
i need to create a map like that dynamically using beginGradientFill().
any ideas?
I managed to create a map that would stretch the overlying image in the y and -y directions. But i need to apply another layer of alphas over it so that the effect of the mask is minimized at the right and left edges while the effect is maximum in the middle.
here’s my code:
w = _root.image._width;
h = _root.image._height;
this.createEmptyMovieClip("mc", this.getNextHighestDepth());
var matrix:Matrix = new Matrix();
matrix.createGradientBox(w, h, Math.PI/2);
mc.beginGradientFill("linear", [0x0000CC, 0x0000AA, 0x000090, 0x000080, 0x000070, 0x000060, 0x000040],
[100, 100, 100, 100, 90, 70, 50], [0, 255/6, 2*255/6, 3*255/6, 4*255/6, 5*255/6, 255],
matrix, "pad","RGB");
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.lineTo(0, 0);
mc.endFill();
var bmp:BitmapData = new BitmapData(w, h, true);
bmp.draw(mc);
var pt:Point = new Point(0, 0);
var dMapFilter:DisplacementMapFilter = new DisplacementMapFilter(bmp, pt, 2, 4, 0, 50,"clamp");//,0x000000,1);
_root.image.filters = new Array(dMapFilter);
please help me.