1.Open a new document in flash.
2.Import a picture (Ctrl+R) in layer one.
3.Change it to movieclip. Go to Properties Panel (Ctrl + F3) and adjust the color as given below.
4.Paste the same picture in layer two then convert it to movieclip and give the instance name as top_picture.
5.Using Photoshop cut the water fall portion and save it in the png format. Import that water fall portion in layer three, change it to movieclip and name it as waterfall.
6.In layer four draw a circle gradient as shown below and convert to movieclip then name it as GradientCircle.
7.Create a layer five to write the following actionscript:
/** code for water fall effect **/
var pt1:Point = new Point(0,0);
var pt2:Point = new Point(0,0);
var perlinOffset:Array = [pt1, pt2];
var bm2:BitmapData=new BitmapData(waterfall.width, waterfall.height);
var disp2:DisplacementMapFilter = new DisplacementMapFilter(bm2,new Point(0,0),1,2,10,0);
var pt3:Point = new Point(0,0);
var pt4:Point = new Point(0,0);
var perlinOffsetFall:Array = [pt3, pt3];
addEventListener(Event.ENTER_FRAME,onFrame);
function onFrame(evt:Event):void {
perlinOffsetFall[0].y -=1;
perlinOffsetFall[1].x -=0.1;
bm2.perlinNoise(20,20,1,99,true,false, 7,false,perlinOffsetFall);
waterfall.filters=[disp2]
}
/** code for spot light effect **/
top_picture.cacheAsBitmap = true;
GradientCircle.cacheAsBitmap = true;
top_picture.mask=GradientCircle;
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE, mds);
function mds(evt:MouseEvent)
{
GradientCircle.x = mouseX;
GradientCircle.y = mouseY;
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, mss);
function mss(evt:MouseEvent){
top_picture.cacheAsBitmap = false;
}
stage.addEventListener(MouseEvent.MOUSE_UP, mas);
function mas(evt:MouseEvent){
top_picture.cacheAsBitmap = true;
}
Leave a Reply