A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Effortless snow through actionscript?

Hybrid View

  1. #1
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    To create a pile up effect, just make a ground variable that the snowflakes stop and and reduce that ground variable as the snow falls.....
    code:



    _root.onLoad = function() {
    ground=400;
    for (i=1; i<100; i++) {
    duplicateMovieClip(mcSnowFlake, "snow"+i, i);
    myFlake = _root["snow"+i];
    myFlake._x = (Math.random(100)*550);
    myFlake._y = (Math.random(100)*400);
    myFlake.onEnterFrame = function() {
    this._y += 5;
    if (this._y>ground) {
    delete this.onEnterframe;
    ground--;
    }
    }
    }
    }



    Hope it helps
    NTD
    Last edited by NTD; 11-30-2004 at 01:48 PM.

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