Hello, can anyone help me modify the following code (the code to make it rain), so instead of the movieclip duplicating and falling, it duplicates and rises...
This code is in the movieclip:
onClipEvent (load) {
//put the size of the movie stage here
movieWidth = 550;
movieHeight = 300;
//variables that will modify the falling snow
//this is for the speed of the falling rain
i = 20+Math.random()*100;
k = -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;
}
}
This code is in the frame:
for (k=0; k<25; k++) {
duplicateMovieClip(_root.rain, "rain"+k, k);
}
Also, I can see this wont work if you import the .swf into anther movie, does anyone know why?
Aha!!! Fantastic, thankyou Bret The rising rain didn't work at first, everything was stuck below the movie,so I fiddled around with it (since you told me where to look). For anyone interested, here's how to reverse the effect... (only a tiny bit different to the above amendments)..
this._y -= i;
if (this._y>=movieHeight) {
this._y = movieHeight+5;
Actually, Ive been messing round with it more now because it only plays the rising rain for about a second.. I've modified almost every part without success, any idea what Im doing wrong???
If you try the original while exporting in flash 5 it should work. This was an old script from several years ago that was played around on in this forum.
Any programming language is at its best before it is implemented and used.
Brilliant, cheers mate. One more problem though, I need it to work inside another movie... Im using it as a background, however, it won't work inside the other movie.. it just displays one rising rain drop. Ive tried changing the _root to parent, but this isnt working... Ive tried chaging the root movie export settings but still nothing... any ideas why it's being difficult?
let me know if it works becuase it took a while to get it to reproduce and I will not say thats its right to begin with. But it shoiuld work with flash 8. If it does then I can put it on koolexchange.
Any programming language is at its best before it is implemented and used.
FANTASTIC MATE!!! The bubbles are awesome and also work inside another movie perfectly!!! I love the added feature of the bubble moving away from the curser slightly, nice touch.. Top effect! Definetly add that to kool exchange.