I suppose you want to act properly if the counter is lower or higher than
defaultSection.
If so:
for (var i:Number = 0; i < maxSection; i++) {
if (i < defaultSection) {
trace("lower " + i);
} else {
trace("higher " + i);
}
}
If you absolutely want to run the "higher" part before you run the "lower"
part, you can do some "code abuse" ;)
for (var i:Number = defaultSection; i < (maxSection * 2 - defaultSection);
i++) {
if (i % maxSection >= defaultSection) {
trace("higher " + i % maxSection);
} else {
trace("lower " + i % maxSection);
}
}
Please correct me if that's not what you want
On Mon, Apr 7, 2008 at 12:13 PM, Helmut Granda <[EMAIL PROTECTED]>
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 ) ;
>
> }
>
> }
>
> On Mon, Apr 7, 2008 at 10:12 AM, Helmut Granda <[EMAIL PROTECTED]>
> wrote:
>
> > Is there a way to edit the code below to be included into just one for
> > loop and would it actually be faster? On a side note any site/book
> > recommendations on "how to" for this kind of odd sequences..
> >
> > TIA
>
>
>
>
> --
> ...helmut
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders