Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Steam effect 2

Status
Not open for further replies.

killbuzz

Technical User
Mar 21, 2001
103
US
Hi, I'm making a flash webpage for a friend. And They have a Steam Pipe coming down and would like to have steam coming out of the pee trap. my question is how would i do this to make it look like real steam.


Thanks.
 
[tt]Can we see the effect?

ams_rank8b.jpg

 
I dont have an effect i need one to i can get an idea on how to do it..
 
Anything like steam is really hard to simultate in Flash because it's not really powerful enough to create a particle system like Director or Lightwave.

The closest I've ever managed is to create a single smoke/steam "particle" with a radial gradient filled circle with the alpha set to 0% at the edges then duplicate it with duplicateMovieClip() and give it some general direction to go in but with a bit of randomness thrown in.

It looks like this:


I was looking for the .fla but couldn't find it but if this is close to what you want let me know and I'll do a quick'n'dirty version of the code for you. Slainte

 
what are you talking about ewan..that is awesome..

with you around who needs lightwave..



logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Here's some code - place it in a control clip and have a radial gradient filled clip offstage called "steam" to get it running.

This definitely needs a quick processor to look good, keeping the "parent" particle reasonably small helps a lot because drawing semi transparent images is one of the heaviest loads on the CPU and the less faded pixels it has to draw the better.

This runs pretty well for me at 25fps with about 40 particles on a P4 1.4GHz PC, drop "amount" if you have something slower and push it up if you have this year's model...

onClipEvent (load) {
//main variables
startX = 275;
startY = 300;
amount = 30;
//set up particles
for (i=1; i<amount; i++) {
duplicateMovieClip(_parent.steam, &quot;steam&quot;+i, i);
clip = _parent[&quot;steam&quot;+i];
//give each particle random speed, drift and size
clip.speed = (Math.random()*3)+.6;
clip.fade = clip.speed/2;
clip.drift = (Math.random()*2-1)/7;
clip._xscale = Math.random()*50+50;
clip._yscale = clip._xscale;
//position on screen
clip._x = startX;
clip._y = startY;
}
}
onClipEvent (enterFrame) {
//move particles
for (i=1; i<amount; i++) {
clip = _parent[&quot;steam&quot;+i];
clip._x += clip.drift;
clip._y -= clip.speed;
clip._alpha -= clip.fade;
//reset particles once they've faded out
if (clip._alpha<1) {
clip._x = startX;
clip._y = startY;
clip._alpha = 100;
}
}
}
Slainte

 
Hi KillBuzz,
Just noticed the request for some steam, I hope this might help, just play around with the fill effects as demo. I should have used the alpha instead of the black fill,this would stop the black incursion, but it may give you some ideas.


all the best

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top