AS3 for Internal loop terminates an outer loop instance

Source: Internet
Author: User
Tags terminates


The following is an example of initialization for A For loop statement:

The code is as follows Copy Code
for (var i:int=0;.) {...}
for (var i:int=9;.) {...}
for (var j:int=1000000;.) {...}
for (var k:uint=1026;.) {...}
for (var l:number=3.14;.) {...}

Test

Each for loop statement requires a termination point. You can use conditional expressions to determine when a loop statement stops executing. The test condition expression must be evaluated before each loop. When the test evaluates to false, the loop statement stops executing and exits.

Inner Loop terminates outer loop

  code is as follows copy code

var i, J:int ;
Outfor:for (i = 0; i < Picarea.numchildren; i++) {
 for (j = i + 1; j < Picarea.numchildren; J + +) {
  if (Right_click (Picarea.getchildat (i), Picarea.getchildat (j))) {
   break outFor;
&NBSP;&NBSP}
 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.