L'image :


Cliquer sur l'image pour démarrer l'effet, puis recliquer pour stopper.

Le code :
import flash.display.BitmapData;
import flash.filters.DisplacementMapFilter;
var bitmapData:BitmapData = new BitmapData(fond._width, fond._height, false, 0x000000FF);
var mc_1:MovieClip = this.createEmptyMovieClip("mc_1", this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData, this.getNextHighestDepth());
mc_1._visible = false;
mc_1._x = 0;
xDecal = 0;
yDecal = 0;
function creaVag() {
xDecal += 0.5;
yDecal -= 5;
myPoint = new flash.geom.Point(xDecal, yDecal);
bitmapData.perlinNoise(300, 25, 3, 5, false, true, 4, false, myPoint);
creaDisplacementMap();
}
function creaDisplacementMap():Void {
var filter:DisplacementMapFilter = new DisplacementMapFilter(bitmapData, new Point(0, 0), 4, 4, 20, 20, "wrap");
fond.filters = [filter];
}
this.onMouseDown = function() {
(foo) ? arret() : joue();
foo = !foo;
};
sea = new Sound(this);
sea.attachSound("clapot");
function arret() {
clearInterval(inter);
sea.stop();
}
function joue() {
inter = setInterval(_root, "creaVag", 50);
sea.start(0, 999);
}