FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


actionscript2.0 - ending a for loop





mothmann
Is there a way to end a for loop prematurely with maybe an if statement. maybe something like

Code:
for (x = 0; x <10; ++x) {
    if (x=5) {
        end loop;
    }
}


I just remembering being able to end for loops in warcraft 3 and it was nice and I'm hoping you can do the same in flash8.
MrBlueSky
Code:

for (x = 0; x <10; ++x) {
    if (x=5) {
        break;
    }
}
makli
MrBlueSky wrote:
Code:

for (x = 0; x <10; ++x) {
    if (x=5) {
        break;
    }
}


You should use
Code:

  if(x==5)


instead of x=5. "=" is an assignment, "==" compares the operands.

HTH

Makli
Related topics
Fortran Tutorials(77)
Weird "Failure to Open Stream" Error
AJAX tutorial [2nd part now updated]
This is my lf2sig code 0.01, anyone see errors?
Spider-man III trailer!!!
Have you seen, what the bleep do we know?
Programming in Assembly Language: x86 - reserved pixel?
Simple menu written in C - Problem with loop
Redirect Error
Actionscript2.0 - Difference between var :Object and new Obj
ActionScript2.0 - importing an external movie clip
TI-Basic help
Mind and Causality
create your own bootanimation on android
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.