PDA

View Full Version : Ending the For Loops



flashermx
June 2nd, 2004, 06:16 AM
We have a For Loop that duplicates and movie Clip.

for (counter=2;counter<=15;counter++) {
duplicateMovieClip(enemy,"enemy"+counter,counter+100);

}

On a hit test we want to remove all the duplicated movieclips. I acomplished this using a new scene with a frame action contianing another For Loop and a remove movie clip action. Hit test true move to new scene play frame action.

for (counter=2;counter<=15;counter++) {
removeMovieClip("enemy"+counter);

}

This worked.

Is there a way to put a stop of the For Loop or Put a stop on the Duplicate movie clip?
:hair:

Voetsjoeba
June 2nd, 2004, 10:18 AM
I'm not quite sure what you are trying to do .. you can abort for, for .. in, do while, while loops and the switch action using the break command (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary078.html), if that's what you mean ...

flashermx
June 2nd, 2004, 10:36 AM
This may be it. I will try tomorrow. Thanks Voetsjoeba.