Hi Michael,

That's how the for-in loop works, no idea why. 
If you want to count forwards, you need to use:
for (var i:Number = 0; i<myArray.length, i++) {
     trace(myArray[i]);
}

Karina
 

> -----Original Message-----
> From: Mendelsohn, Michael [mailto:[EMAIL PROTECTED] 
> Sent: 20 June 2006 14:31
> To: Flashcoders mailing list
> Subject: [Flashcoders] For...in counts backwards?
> 
> Hi list...
> 
> >From the help on "for...in":
> 
> You can also iterate through the elements of an array:
> 
> var myArray:Array = ["one", "two", "three"]; for (var 
> i:String in myArray) {
>     trace(myArray[i]);
> }
> 
> 
> This code outputs the following in the Output panel:
> 
> three
> two
> One
> 
> 
> Why is the data output in reverse order and is there any way 
> of ordering it one,two,three?
> 
> Thanks,
> - Michael M.
> 
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> 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
> 
> 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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