Hi all.
Managed to find this really cool snow effect but trying to remove the mouse interaction, but in doing so the snow seems to stop or fade after five or ten seconds due to removing the mouse elements, however if they are in place without any hit with the mouse the snow still continues to fall regardless so in effect I need the snow to keep running without any effect from the mouse, here is the actionscript as below. Any help would be great.
cheers
//
var total = 0;
//
function setQuality(thisSpeed) {
if (thisSpeed == 1) {
total = 100;
} else if (thisSpeed == 2) {
total = 300;
} else {
total = 400;
}
}
setQuality(_global.speed);
/////////////////////////////////////
function createParticles() {
for (var i = 0; i<total; i++) {
this.ele.attachMovie("bit", "bit"+i, i++);
var clip = this.ele["bit"+i];
clip.force = 0;
clip.mn = 1+Math.random()*1.5;
clip.x = Math.random()*2-0.75;
clip.y = Math.random()*2;
clip._x = (Math.random()*this.frame_mc._width)+left;
clip._y = Math.random()*200-220;
clip._xscale = 70+Math.random()*290;
clip._yscale = 70+Math.random()*290;
clip.ct = Math.floor(Math.random()*60);
clip.c = 0;
clip.onEnterFrame = function() {
this.c++;
if (this._x<_x/*mouse*/) {
this.x -= this.force;
} else {
this.x += this.force;
}
if (this.force>0) {
this.c = 0;
this.force *= 0.6;
if (this.force<0.05) {
this.force = 0;
}
}
if (this.c>this.ct) {
this.x = Math.random()*5-1.5;
this.c = 0;
this.ct = Math.floor(Math.random()*60);
}
this._y += (this.y+this.mn)-(this.force*9);
this._x += this.x;
if (this._x<left-5) {
this.x = Math.random()*5-1.5;
this.force = 0;
this._x = right+2;
}
if (this._x>right+5) {
this.x = Math.random()*5-1.5;
this.force = 0;
this._x = left-2;
}
if (this._y>_y/*mouse*/-25 && this._y<_y/*mouse*/+25 && this._x>_x/*mouse*/-35 && this._x<_x/*mouse*/+35) {
this.force += Math.random()*5;
} else if (this._y>=bottom+5) {
this.force = 0;
this.x = Math.random()*5-1.5;
}
};
}
}
//
/*function clearAll() {
for (var i = 1; i<=total; i++) {
removeMovieClip(this.ele["bit"+i]);
}
}*/
//
createParticles();
//stop();