PDA

View Full Version : Continuing loop


mogabe
11-26-2002, 08:30 AM
I'm a reel newbie in action script. I'm trying to make snow, and I can't make the loop go and go and go. You want snow all the time, not just 50 flakes once.

i = 1;
while (i<50) {
_root.flake.duplicateMovieClip("flakex"+i, i);
_root["flakex"+i]._x = random(500);
_root["flakex"+i]._y = 0;
i += 1;
}

this is what the source looks like. I just want to know how to make it not to stop.

Thanks

tost
11-26-2002, 08:33 AM
frame 1:

i = 1;


frame 2:

_root.flake.duplicateMovieClip("flakex"+i, i);
_root["flakex"+i]._x = Math.random(500);
_root["flakex"+i]._y = 0;


frame 3:

i ++;
gotoAndPlay(2);

annexion
11-26-2002, 03:08 PM
_root.onEnterFrame=function(){
i++;
_root.flake.duplicateMovieClip("flakex"+i, i);
_root["flakex"+i]._x = Math.random(500);
_root["flakex"+i]._y = 0;
}


This should work too.