Create water ripple drop at specified point on a MovieClip
4 Comments January 13th, 2009
Summary
In this tutorial you will learn how to create a water ripple on a specified point on a MovieClip, that can contain any kind of content (images, videos and text).
Here the final result:
Requirements
Flash 8, Flash CS3 or Flash CS4.
One images (in this case 550×400, image available in the tutorial zip file)
Note: The screenshots in this tutorial are made in Flash CS3. It works exactly the same in Flash 8 or Flash CS4. This tutorial is ActionScript 2 (please write a comment if you like to have the ActionScript 3 version).
Step 1 – Install the effect component
Download the Rain Drop Water Effect. Please follow the installation instructions and drag the component from the component panel into the library of your .fla file.
Step 2 – Create target Movieclip
Import an image “File” -> “Import” -> “Import to Stage…”.
Create a Movieclip by selecting the image, right click and select “Convert to Symbol”. Name it “image”.
Set the instance name of the Movieclip to “img”.
Step 3 – Add Create Drop ActionScript
Rename the layer with the image Movieclip to “image”. Create a new layer and name it “script”. Right Click in the first frame of the “script” layer and select “Actions”.
The ActionScript window opens. Copy and past the following code.
var ff_component:MovieClip = this.attachMovie("RainDropEffectAS2", "RainDropEffectAS2", 1);
ff_component.init(img, 3, 0, false, false);
ff_component.createDrop(200, 200);
Line 1 attaches the component on stage. Line 2 initializes the component (you can find the complete api for the effect here). Line 3 finally creates a drop on the given position.
In this case on x-position 200 and y-position 200. Please use the coordinates you like to have. Note that the first parameter (x-position) must not be bigger then the width of the target Movieclip and the second parameter (y-position) must not be bigger then the height of the target Movieclip.
Download
Click here to download the .fla of this tutorial. Note: The .fla includes the trial version of the effect component, which will only work in the Flash IDE (Flash 8, Flash CS3 or Flash CS4) but not inside the browser.
You can also download the Rain Drop Water Effect here.
Here you can find a video tutorial of how to implement a different effect.









4 Comments
I’d LOVE the AS3 code for this. Though the tool is simple to use, I find their tutorial for using the AS applications to be terrible. So, I’m sitting here trying every combination of the source code they provided.
What you did is just want I want to do, a nice controlled, predictable placement of the splash.
Many thanks!
~Harris
Edit! I’m an idiot, & I got it. Your code made all the difference, I just hadn’t figured out what to omit, and what to include. It turns out I had omitted something rather important…
You have my thanks again
I’d love to get the AS3 code for this as well. Thanks in advance!
god how you made it work to start on specific frame ? (i mean without clic or mouse action) cause i have this component either… as i’m newbie in flash… i modified the code they gave to start a single drop on clic in what i thought good to start on specific frame:
addEventListener(Event.ENTER_FRAME,createDrop);
function createDrop(e:Event)
{
ff_component.createDrop(200, 150);
}
and the animation starts well on the frame i decided.. but freezes after first image… then i stay with something looking like a square in the middle of the picture…
what did i do wrong ?
can you make this code for AS3 ?
i would love to make it work … thx a lot
Write a Comment