You'll want to use a particle system that follows the rules of gravity and possibly wind, if you want. It'd look something like this...
Draw a water drop and make it a movieclip. Have it set to "Export for Actionscript" with the linkage name "water".
This should spray water drops everywhere. I haven't tested it so let me know if it doesn't work.Code:density = 2; gravity = 1; wind = 2; createEmptyMovieClip("sprinkler", 0); sprinkler.depth = 0; sprinkler.onEnterFrame = function() { for (var i=0; i<density; i++) { var clip = this.attachMovie("water", "water"+this.depth, this.depth++); clip._x = Stage.width/2; // x origin for water clip._y = Stage.height-100; // y origin for water clip.xspeed = Math.random()*6-3; // initial velocity horizontal clip.yspeed = -Math.random()*15; // initial velocity upwards clip.onEnterFrame = function() { this._x += this.xspeed; this._y += this.yspeed; this.xspeed += wind; this.yspeed += gravity; if (this._x < 0 || this._x > Stage.width || this._y > Stage.height-100) { removeMovieClip(this); } }; } };
If you want the drops to fluctuate (directed spray at an oscillating angle), I would use a sine wave. Lemme know if you need help with that.




Reply With Quote