Actionscript 3 Wave Effect


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var bm:BitmapData=new BitmapData(img_mc.width, img_mc.height);
  2. var disp:DisplacementMapFilter = new DisplacementMapFilter(bm,new Point(0,0),1,2,20,25, DisplacementMapFilterMode.CLAMP);
  3. var offsets:Array = [new Point(0, 0), new Point(0, 0)];
  4.  
  5. addEventListener(Event.ENTER_FRAME, doUpdate);
  6. function doUpdate(evt:Event):void
  7. {
  8. offsets[0].x -=4;
  9. offsets[1].y -=1;
  10. bm.perlinNoise(45, 20, 2 ,50, true, false, 7, true, offsets);
  11. img_mc.filters=[disp];
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.