Need Help!

I don’t know why when i tried to create a falling snow animation using actionscript it either one work and the other won’t why??

below is my code that i use for each one of them

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

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

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*50;
this._alpha = 75+Math.random()*50;
this._x = -10+Math.random()*movieWidth;
this._y = -10+Math.random()*movieHeight;

}
onClipEvent (enterFrame) {
//putting it all together
rad += (k/50)*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 this one comes with the one on top but this action is put in the frame 1

for (k=0; k<25; k++) {
duplicateMovieClip(_root.bluestar, “bluestar”+k, k);
}


This one is for a stripe or rain as i call it…

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

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

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*50;
this._alpha = 75+Math.random()*50;
this._x = -10+Math.random()*movieWidth;
this._y = -10+Math.random()*movieHeight;

}
onClipEvent (enterFrame) {
//putting it all together
rad += (k/50)*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;
}
}

Code for the Frame also on frame 1 but on different layer

for (k=0; k<25; k++) {
duplicateMovieClip(_root.rain, “rain”+k, k);
}

sorry it’s long. if anyone know anything about this please reply and also how can I move the animation to where ever I put it to.

let say I want the blue star to be bottom only and not at the top or at the corner only. Please let me know i am a beginner at this thanks!! if i miss some info about my question please let me know also…

thanks in advanced

It may have something to do with where your code is placed. Could you post your fla?

thanx for helping me out

please follow the link below to download my .fla file

http://www.i-marketings.com/cp/spacelayout.ace

the file is kinda big and it’s kinda messy when you look into it.

thankz in advanced

What’s an ace file?? Could you zip it instead?

lol use winace to unzip it ;0) winace.com

alrite let me put it to zip file

http://www.i-marketings.com/cp/space.zip

okay, make an extra movieClip off of the stage, could be empty, whatever. Put this on it:


onClipEvent (load) {
	for (k=0; k<50; k++) {
		duplicateMovieClip(_root.redstar, "redstar"+k, k);
	}
}

Then remove the “redstar” code from the timeline.

The problem you’re having is that it duplicates the movieClips onto level0. You cant have two of them on the same level, so move your code to the other movieClip and it should work for you. :stuck_out_tongue: