Skip to content

Instantly share code, notes, and snippets.

@arpit
Created February 5, 2010 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arpit/296050 to your computer and use it in GitHub Desktop.
Save arpit/296050 to your computer and use it in GitHub Desktop.
import flash.filters.DisplacementMapFilter;
import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.geom.Point;
var str = 100;
this.addEventListener (Event.ENTER_FRAME,enterframe);
function enterframe (e:Event):void {
var map:BitmapData = new BitmapData (1400, 1250, false, 0xe80000);
var mtx:Matrix = new Matrix();
mtx.translate(mouseX-253, mouseY-166);
this.sourceMap.visible = false;
map.draw(this.(DISPLACE_CLIP), mtx);
var dmf:DisplacementMapFilter = new DisplacementMapFilter(map, new Point(0, 0), 1, 1, 0, str, "clamp", 0x000000, 1);
(DISPLACEE).filters = [dmf];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment