Hi,

I'm using Flash MX

I got this open source code to create a lighting effect off of text. I am using the effect for an intro to a website. My problem is that I have not been able to stop the loop.

i = "1";
alpha = "0.8";
maxlight = "20";
while (Number(i)<=Number(maxlight)) {
duplicateMovieClip("ray0", "ray" add i, 800-i);
setProperty("/ray" add i, _xscale, getProperty("/ray" add (i-1), _xscale)+i*alpha);
setProperty("/ray" add i, _yscale, getProperty("/ray" add (i-1), _yscale)+i*alpha);
setProperty("/ray" add i, _alpha, 10-i*(0.5/50));
i = Number(i)+1;
}
setProperty("ray0", _visible, "0");

I have tried 'break' but, because I'm not entirely sure of the syntax, it breaks the entire clip before it even starts. I've used "removeMovieClip" as well, but I think the problem here is addressing the the duplicated movie clip correctly. I have tried addressing it as, "ray0," "ray" and "/ray" and none of them work.

I just want this thing to iterate about three times and then jump to another clip.

Any help would be appreciated. Thanks beforehand!