Something like this with ':' to create the label:

var n:int=0;
  LOOP_A: while(n < 10)
  {
    var z:int=0;
    LOOP_B: while(z<20){
       if(n == 3){
          break LOOP_A;
       }
       z++;
    }
    n++;
  }


You can do it with any block of code like this:

chido :
{
  trace("Quantium Rules");
  break chido;
  trace("This couldn't appear")
}

2007/4/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:


I seen this kind of syntax for loops where you can use "break" to break
out of a specific loop that you named.

Is it possible to do this in AS3?
If so, please give an example with proper syntax.

Thanks
-- Keith H --


//Not sure if my syntax is right.
//Use identifier "LOOP_B" to break out of the outer loop "LOOP_A"
var n:int=0;
LOOP_A while(n < 10)
{
  var z:int=0;
  LOOP_B while(z<20){
     if(n == 3){
        break loopA;
     }
     z++;
  }
  n++;
}

--Keith H--

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Andrés González Aragón
Desarrollador Multimedia
http://www.quantium.com.mx
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to