Your if statement is pointless because defaultSection is ALWAYS less than maxSection because you're not altering either of those variables.

That being said, this is much faster:

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

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

Helmut Granda wrote:
oh yeah.... forgot the loop:

var defaultSection    : Number = 3;
var maxSection        : Number = 6;

for (var i : Number = defaultSection ; i < maxSection + 1 ; i ++ )

    {

        trace ( " - " + i ) ;

    }


if (defaultSection < maxSection)

    {

        for (var i : Number = 1 ; i < defaultSection ; i ++ )

            {

                trace ( " - " + i ) ;

            }

    }

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to