Water Effect
Written on June 10, 2007 by admin
First of all create a new flash document, (ctrl + N, or file -> New)
Create a new movie clip, do this by going to
Insert -> New Symbol
Or for the keyboard shortcut, it's ctrl + f8.
Select "Movie clip" for the type, and name it what you wish.
It then takes you inside the movie clip you just created.
Add an image, or something that may look good with water, I left it blank, doing this, makes the background wave around like water.
Go out of the movie clip by clicking "scene 1" on the timeline.
Open the Library by going to
Window -> Library
or press ctrl + L for the shortcut.
Drag out the movie clip you just made.
In the properties panel at the bottom, type in the instance name of "water_mc"
Make a new layer, and name this actions.
Click on the first frame of this layer and type in the following code.
-
import flash.display.*;
-
import flash.geom.*;
-
import flash.filters.*;
-
myBitmap = new BitmapData(390,293,false,0);
-
pt = new Point(0,0);
-
mpoint = new Point(0,0);
-
myDispl = new DisplacementMapFilter(myBitmap, mpoint,1,2,10,50);
-
water_mc.myList = new Array();
-
water_mc.myList.push(myDispl);
-
water_mc.filters = water_mc.myList;
-
i = 1;
-
this.onEnterFrame = function()
-
{
-
filterList = water_mc.filters;
-
offset = new Array();
-
offset[1] = new Object();
-
offset[1].x = i;
-
offset[1].y = i/8;
-
myBitmap.perlinNoise(45,5,3,50,true,false, 7,true,offset);
-
filterList.mapBitmap = myBitmap;
-
water_mc.filters = filterList;
-
i++;
-
}
For an example of the final product, click here.



I have a flash tutorial website. I’m looking for link exchanges. Email me if you are interested.
thanks.
Jared
thejaredholland@gmail.com
[…] sayfan?n yard?mc? olaca??n? tahmin ediyorum. Flash olarak su efekti eklemek isterseniz buyrun ?uraya. Yok ben u?ra?amam flash ile, otomatik bir ?eyler yok mu derseniz, buyrun ?uraya bir göz […]