Hi, I had download a snow fla from this site. And i put at my moive. But when i want the snow to stop somewhere of the frame. ITs still keep going falling snow. Anyone know how to fix this problem?
The code as below
//
// Snowfall algorithm by Grant Skinner. Check out http://gskinner.com/ for updates, more source code and other good stuff.
// To use:
// copy this code into the timeline you wish to display snowflakes in.
// copy the “snowflake” movieclip from this movie’s library into your movie’s library.
// set the variables below.
//
// Edit these values:
maxSnowFlakes = 60;
snowFallWidth = 780;
snowFallHeight = 400;
windStrength = 50;
// 0-100
snowRate = 10;
// 1-50 (smaller number is more flakes per second)
// don’t touch anything below this line:
function startSnowFall() {
// set up the interval:
snowIntervalID = setInterval(this, “doSnowfall”, 50);
// initialize values:
snowFlakeCount = windSpeed=windSpeedTarget=windAcc=nextWindChange=0
;
}
function doSnowfall() {
// wind calculations
nextWindChange–;
if (nextWindChange<=0) {
// change wind speed target
nextWindChange = random(200)+50;
windSpeedTarget = Math.round(random(windStrength)-windStrength/2)/5;
}
windAcc += (windSpeedTarget-windSpeed)/60;
windAcc *= 0.8;
windSpeed += windAcc;
if (snowFlakeCount // add a snowflake:
snowFlakeCount++;
this.attachMovie(“snowflake”, “s”+snowFlakeCount, snowFlakeCount);
}
}
function endSnowFall() {
for (var i = 1; i this[“s”+i].removeMovieClip();
}
clearInterval(snowIntervalID);
}
// END snowflake algorithm
stopSnowFall();