There is no specified ordering for the for .. in loop.
It seems to be the order, in which the elements were added to the array, but you should only use for .. in, if order has no importance.

Janosch


Mendelsohn, Michael schrieb:

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.

_______________________________________________
[email protected]
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



_______________________________________________
[email protected]
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