generateWater();

This code doesnt work. I have the slightest idea why…

[AS]function generateWater(amount, size) {
for (i; i<amount; i++) {
ID = _root.createEmptyMovieClip(“water”+i, i);
ID.lineStyle(size, 0x0000FF, random(75)+25);
ID.moveTo(_xmouse, _ymouse);
ID.lineTo(_xmouse+5, _ymouse+5);
}
}
generateWater(1, 10);[/AS]

Thanx Ilyas it works!

Wait… now there’s another problem. When the function is called multiple times, evrytime it is called, it just replaces the water drops with new ones. Here is the code: [AS]xoffset = 150;
yoffset = 200;
function generateWater(amount) {
for (i=0; i<amount; i++) {
id = _root.createEmptyMovieClip(“water”+i, i);
id.yspeed = random(20)+20;
id.xspeed = random(10)-5;
id.lineStyle(10, 0x0000FF, random(75)+25);
id.moveTo(xoffset, yoffset);
id.lineTo(xoffset, yoffset+1);
id.onEnterFrame = moveWater;
}
}
function moveWater() {
this._y -= this.yspeed;
this._x += this.xspeed;
this.yspeed -= 3;
}
onEnterFrame = function () {
generateWater(1);
};
[/AS]

xoffset = 150;
yoffset = 200;
cDepth = 0;
function generateWater(amount) {
        for (i=0; i<amount; i++) {
cDepth++;
                id = _root.createEmptyMovieClip("water"+cDepth, cDepth);
                id.yspeed = random(20)+20;
                id.xspeed = random(10)-5;
                id.lineStyle(10, 0x0000FF, random(75)+25);
                id.moveTo(xoffset, yoffset);
                id.lineTo(xoffset, yoffset+1);
                id.onEnterFrame = function() {
        this._y -= this.yspeed;
        this._x += this.xspeed;
        this.yspeed -= 3;
};
        }
}
generateWater(2);

Yes… thank you norie, i see the problem now.