Unfortunately, there's no 'goto' command in Flash, although it would come in handy in this case - this is what happens when language designers get overly politically correct.
Here's a few things you could do:
1. Put the whole thing in a function and use return. Costs a little extra for the function call, but possibly not as much as adding a condition to the outer loop.
code:
myLoopy = function()
{
for(i = 0;i < 10;i ++) {
for(n = 0;n < 10;n ++) {
if(myFunction(i,n)) {
//do something
//break out of both loops
return;
}
}
}
}
2. Use a single loop. Unfortunately, more processor intensive than adding a condition on the outer loop.
code:
for(x = 0;x < 100; x++){
if (myFunction(Math.floor(x/10),x%10)) {
//do something
//break out of both loops
break;
}
}
3. Your original suggestion. Probably not that painful, since the bulk of your CPU time happens in the inner loop. This is the choice I'd probably use myself.
code:
over = false;
for (i = 0; i < 10 && !over; i++) {
for (n = 0; n < 10; n++) {
if (myFunction(i,n)) {
//do something
//break out of both loops
over = true;
break;
}
}
}