Right.  I should have set j inside in the if statement each time.

var defaultSection:int = 3;
var maxSection:int = 6;
var i:int = maxSection + 1;
var j:int;

while (i--)
{
   trace( "i = " + i );
   if (defaultSection < maxSection)
   {
       j = defaultSection;
       while (j--)
       {
           trace( "j = " + j);
       }
   }
}

However, somebody managed to suss out what Helmut was really trying to achieve. Their second example, however, was the exact opposite of what Helmut wanted, which was an efficient loop.

Doing any kind of math or function call in the comparison function of a loop is the polar opposite of efficiency. ;)
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to