Bonjour à tout le monde,
J'ai glisser ce script suivant sur ma timeline pour provoquer une chute de neige mais je ne sais absolument pas comment l'arreter au moment voulu...
OnEnterFrame;
width = 1280; // width
height = 956; // height
total = 200; // total
for (var t = 0; t != total; t++) {
var mc = _root.attachMovie("snowflake", "snowflake"+t, _root.getNextHighestDepth());
mc._x = (Math.random()*(width+20))-10;
mc._y = (Math.random()*(height+20))-10;
mc.yspeed = (Math.random()*1.75)+0.25;
mc.speed = (Math.random()*3)+2;
mc._xscale = mc._yscale=(mc.speed+mc.yspeed)*10;
mc.onEnterFrame = function() {
var angle = Math.atan2(_root._xmouse-(width/2), _root._ymouse)+1.5707963267949;
this._y += Math.sin(angle)*this.speed+this.yspeed;
this._x += Math.cos(angle)*this.speed;
if (this._x>width+10) {
this._x = -10;
} else if (this._x<0-10) {
this._x = width+10;
}
if (this._y>height+10) {
this._y = -10;
} else if (this._y<0-10) {
this._y = height+10;
}
};
}
Merci d'avance car je bloque royalement la![]()
Partager