|
-
Senior Member
Falling Snow
I am trying to create the effect of falling snow. Right now I can get the instance of snow to position randomly horizontally (however you say that) and that is fine, but I can't figure out how to duplicate the snow. I want to have a lot of the snow instances on stage, probably about like 60 or something, and I want them to randomly float to the bottom of the screen. Can anyone help me with the duplicating the clips part?
"If I have seen further it is by standing on the shoulders of giants." Isaac Newton
------------------------------------------------------------------------------
-
Senior Member
See the nearby thread (about 20 down) about "bubbles rising upward".
A few lines need modifying, but it's nearly there. Change this bit:
code:
this._y -= this.speed;
if (this._y < -this._height) {
this._y = SH+this._height;
}
To this:
code:
this._y += this.speed;
if (this._y > SH+this._height) {
this._y = -this._height;
}
-
-
Also if you want to create a lot of snow instead of putting a duplicateMovieClip in a frame loop.
var i = 0;
function makeSnow(){
i++;
duplicateMovieClip("snow","snow"+i,i)
}
myInterval = setInterval(makeSnow,"a speed in miliseconds here");
Justin Blough
MindWireMedia
(719) 659-8062
[email protected]
http://www.mindwiremedia.net
-
Senior Member
Finally I got back on my computer and was able to look at this post. Thanks everyone for helping. I think I've got the duplicating to work, now I am going to try and figure out how to move it. Thanks again
"If I have seen further it is by standing on the shoulders of giants." Isaac Newton
------------------------------------------------------------------------------
-
Senior Member
Never mind. I was using MindWire's code, but what happens now is that the snow pops up in the middle of the movie, and that is a little weird. This is the code that the I want to use, but I get in error when I try to test the movie. It says the script will slow my computer down.
snowflakes = 75;
do {
duplicateMovieClip(snow, "snow"+k, k);
k++;
} while (k != snowflakes);
"If I have seen further it is by standing on the shoulders of giants." Isaac Newton
------------------------------------------------------------------------------
-
Senior Member
Nevermind again, scratch the last message, all I did was I added
if(k == undefined) {k = 0}; thanks jbum
"If I have seen further it is by standing on the shoulders of giants." Isaac Newton
------------------------------------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|