Hi there!
I am new at flashing, I am getting the hang of it. I cant code much, I am just shugging along learining to mod it a bit.
This is regarding the snow tutorial, I am trying to change it so it goes up, I got that far, I siwiched places for the ‘k’ and ‘i’ variables in:
k = 1+Math.random()*2;
i = -Math.PI+Math.random()*Math.PI;
I am trying to make it go off in the background. But it hops over all the layers and always appears on top of everything! Any idea how to keep it down! They also only flow once and disapear, i changed the width and height in the code but they still dont repeat. And can anyone tell me how to make em flow sideways?
Also, I tried to create a second flake of a diffrent color to flow but it dosent work, I used the same code for both, I just copied it from one to the other.
Nifty trick on the reverse effect of the snow. So far the snow effect goes up, but then pauses mysteriously. Trying to get it to fly up in a steady stream. Nothing seems to be working in my tweaks with the code.
I dont know how to make the reverse snow keep going either, I don’t know code enough for that! Thats why I asked. For me it dosent matter, its acctualy a nice touch. Because it keeps people from getting distracted for too long, but I would still like to find out how to keep it flowing!
Post your codes, guys. And concerning the colors, I don’t see why it would be more processor intensive, Lost. Just make 2 snowFlakes, with 2 separate linkage names, and attach randomly one of them.
Well yes, it sounds simple but when I tried it the second snowflake just goes up once and thats it… It dosent even repeat itself just one snowflake! The code is the same on the Snow Effect Tutorial. Except the ‘k’ and’i’ switch I did, (see first post)
And why do they just stop flowing too? anyone?
Sorry about that Lost. It’s a Flash MX file, but maybe it’s the way I’m posting it. I’m on a Mac if that’s an issue.
I’ve saved it out as a Flash 5 version. In case you can’t crack that open, here’s the code that resides on the snowflake movie clip:
onClipEvent (load) {
//specifies the size of the movie stage
movieWidth = 300;
movieHeight = 200;
//variables that will modify the falling snow
k = 1+Math.random()*2;
i = -Math.PI+Math.random()*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()*movieWidth;
this._y = -5;
}
}
And if I get what you are trying to do correctly, then it is a simple fix…
Find this line…
if (this._y>=movieHeight) {
this._y = -5;
}
And replace it with…
if (this._y<=0) {
this._y = movieHeight;
}
What this does is that instead of resetting it to the top of your movie when it gets to the bottom it sends it to the bottom of your movie when it gets to the top