Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá Pessoal.
Peguei um código de duplicateMovieClip de efeito de neve, ele funciona certinho, só que tenho uma action que quando eu clico no movie ele rotaciona em 180 deixando o objeto de ponta cabeça, o problema é que a neve continua caindo, na verdade subindo porque ela tb foi rotacionada. Gostaria de saber se tem como, depois do clique ela inverter os 180 e começar a sumir, como se estivesse acabando, parando.
Segue abaixo o meu código
Fora do movie
for (k=0; k<1500; k++) {
duplicateMovieClip(_root.mvGlobo.mvNeve.Neve, "Neve"+k, k);
}
Dentro do movie
onClipEvent (load) {
//specifies the size of the movie stage
movieWidth = 500;
movieHeight = 800;
//variables that will modify the falling snow
i = 1+Math.random()*1;
k = -Math.PI+Math.random()*Math.PI;
//giving each snowflake unique characteristics
this._xscale = this._yscale=30+Math.random()*10;
this._alpha = 55+Math.random()*100;
this._x = -10+Math.random()*movieWidth;
this._y = -200+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
//putting it all together
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = -100;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*movieWidth;
this._y = 100;
}
}
Valeu, abraço
Carregando comentários...