To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-27-2006, 07:22 PM   #1
tim_ver
Senior Member
 
Join Date: Feb 2004
Posts: 491
Sprinkler animation

I want to have a sprinkler spray water out of it from left to right. Anyone done this or know of a website that has?

Thanks
tim_ver is offline   Reply With Quote
Old 06-27-2006, 08:13 PM   #2
thekillerbigmac
Senior Member
 
thekillerbigmac's Avatar
 
Join Date: Jul 2001
Posts: 284
specifically, I do not know of a website that has done it, and I sure havent tried. Your quesiton is a little broad and general. I'm not sure exactly what to tell you. But I can't just make something for you. I would try and learn a little more about MovieClips, and attaching MovieClips with actionscript. This might give you a better idea of what you want to accomplish other than "make a sprinkler"... If you want my advice. Try and make a MovieClip that attaches another MC of water over and over. Then try and make it spurt from that MC into different directions with different _x and _y speeds. It would take a little trying it out to get it right. But learn a little more to try and understand what you are creating before creating it.

Hope I could help!

~Bill
__________________
So many Ideas

So little Time
thekillerbigmac is offline   Reply With Quote
Old 06-27-2006, 08:24 PM   #3
tim_ver
Senior Member
 
Join Date: Feb 2004
Posts: 491
I have looked online and I have tried some idea samples with know luck so far.
tim_ver is offline   Reply With Quote
Old 06-27-2006, 09:42 PM   #4
marshdabeachy
The One
 
Join Date: Jun 2003
Posts: 391
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".

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);
         }
      };
   }
};
This should spray water drops everywhere. I haven't tested it so let me know if it doesn't work.

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.
marshdabeachy is offline   Reply With Quote
Old 06-28-2006, 12:41 AM   #5
tim_ver
Senior Member
 
Join Date: Feb 2004
Posts: 491
Ok I have tried this and not working, Maybe it is me not sure.
tim_ver is offline   Reply With Quote
Old 06-28-2006, 12:46 AM   #6
tim_ver
Senior Member
 
Join Date: Feb 2004
Posts: 491
I got it now. I need it to come from the center of the back and fall down and go from left to right and then slide back fast to the left again and repeat. Ideas on this? I am trying to make a sprikler but not sure how to make it move with the spray and add the noise also.

Last edited by tim_ver; 06-28-2006 at 01:23 AM.
tim_ver is offline   Reply With Quote
Old 03-29-2007, 04:47 PM   #7
schaapke
Senior Member
 
Join Date: Oct 2001
Location: Belgium
Posts: 467
-- OOps --

Sorry, replied by accident when reading this topic.
schaapke is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash MX

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:53 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.