A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Falling Snow

Hybrid View

  1. #1
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784

    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
    ------------------------------------------------------------------------------

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    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;
    }


  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  4. #4
    Member
    Join Date
    Oct 2003
    Location
    Colorado Springs
    Posts
    82
    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

  5. #5
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    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
    ------------------------------------------------------------------------------

  6. #6
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    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
    ------------------------------------------------------------------------------

  7. #7
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center