I’m hoping someone has a suggestion to this issue.
I created a snow animation basically the same way that was in a tutorial on here.
Here is the code i’m using:
init = function () {
width = 900;
// pixels
height = 300;
// pixels
max_snowsize = 10;
// pixels
snowflakes = 50;
// quantity
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 20+Math.random()*60;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*2;
t.wind = -1.5+Math.random()*(1.4*3);
t.onEnterFrame = mover;
}
};
mover = function() {
function fadeOut() {
this._alpha = 0;
}
this._x += this.k;
this._y += this.wind;
if (this._y>height+10) {
this._x = -20;
}
if (this._x>width+20) {
this._y = -(width/2)+Math.random()*(1.5*width);
this._x = -20;
} else if (this._x<-20) {
this._x = -(width/2)+Math.random()*(1.5*width);
this._y = -20;
}
}
init();
I took the idea to make a fog effect instead. Switched the x and y values so the fog would roll in from left to right. that works fine. The problem is that the fog just ends abruptly and comes in all the same.
Is there a time based way, or something to go along with the snow tutorial that will cause the object to fade in and fade out…not just dissapear. I think i’m looking for an actionscript solution. I know how to do it it using alpha and tweens or transitions but that would involve guessing on when the snow will stop falling. Any help would be great.
thanks,
chris