Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread ryanm
Why is the data output in reverse order and is there any way of ordering it one,two,three? Because object are FILO, and yes, use the numbered index. ryanm ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archi

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Aaron Buchanan
Great article, thanks steven! On 6/20/06 10:22 AM, "Steven Sacks | BLITZ" <[EMAIL PROTECTED]> wrote: >> That's how the for-in loop works, no idea why. > > for in loops go backwards because they compile to reverse loops which > are MUCH faster than forward loops. For more detailed information o

RE: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Steven Sacks | BLITZ
> That's how the for-in loop works, no idea why. for in loops go backwards because they compile to reverse loops which are MUCH faster than forward loops. For more detailed information on this subject, check out the Flasm page. http://flasm.sourceforge.net/#optas Here are the fastest loops:

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Julien Vignali
Well the order of your strings is something subjective... You should use Array.sort([function]) and create a custom sorting function that would sort your array the way you want: var array:Array = ["seventy-four", "ten", "twelve"]; function sortByStringLength(a:Object, b:Object):Number { if (S

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Danny Kodicek
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 There's a pretty good reason, in fact (or at least, this is why it's done in Director, can't speak for Flash). The reason is that if you delete an element from

RE: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Bieniasz, Myles
dy brought out for...in can be unpredictable -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Wheeler Sent: Tuesday, June 20, 2006 9:49 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] For...in counts backwards? Mendelsohn, Michael wrote: > Hi l

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Ron Wheeler
Mendelsohn, Michael wrote: 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 O

RE: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Karina Steffens
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 -Original Message- > From: Mendelsohn, Michael [mailto:[EMAIL PROTECTED] > Sent: 20 June 2006 14:31 > To: Flashcoders mailing list > Subject: [Flashcoders]

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread janosch
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 iterat

Re: [Flashcoders] For...in counts backwards?

2006-06-20 Thread Arul Prasad M L
for..in usually loops thru the elements in 'reverse' order; though, the for..in loop's output is supposed to be in a unpredictable order. If you want the elements to be in a