Image

Imagedaitengu wrote in Imageflashdev

Another Question that is stumping me

Why does this code act differently when published with Flash Player 6 compared to Flash Player 7?


onClipEvent (load) {
//specifies the size of the movie stage
movieWidth = 800;
movieHeight = 700;

//variables that will modify the falling snow
i = 1+Math.random()*2;
k = -Math.PI+Math.random(100)*Math.PI;

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._alpha = 75+Math.random()*100;
this._x = -10+Math.random()*movieWidth;
this._y = -10+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 = -5;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*800;
this._y = -5;
}
}


I got this from a tutorial on how to make snow falling. When it is published in Flash player 6 it has a nice side to side motion when it is falling down like it is floating on the wind. In Flash player 7 it looses all side to side motion and simply falls straight down.

Thanks for your help,
-C