RE: [flexcoders] Looping through sorted ObjectProxy

2007-04-18 Thread Peter Farland
Of bjorn - Sent: Tuesday, April 17, 2007 3:18 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Looping through sorted ObjectProxy Actually, it doesn't .. If I look in my debugger - this is how the object looks: obj.stats = Object (@3ff4c81) [13] = Object (@3ff40c1) [14] = Object

RE: [flexcoders] Looping through sorted ObjectProxy

2007-04-17 Thread Alex Harui
For..in does not guarantee order. You could theoretically call it twice and get different results. You might have to find a way to get an array. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bjorn - Sent: Monday, April 16, 2007 12:06

Re: [flexcoders] Looping through sorted ObjectProxy

2007-04-17 Thread bjorn -
Thanks for answering Alex. I solved it by adding a sort_order on the server side and using it for index when creating an Array on the client. like this: for each (var value:Object in obj.stats) { arr[ value.sort_order ] = value; } .. I was just puzzled by the fact that it always looked

Re: [flexcoders] Looping through sorted ObjectProxy

2007-04-17 Thread bjorn -
Actually, it doesn't .. If I look in my debugger - this is how the object looks: obj.stats = Object (@3ff4c81) [13] = Object (@3ff40c1) [14] = Object (@40333c1) [15] = Object (@3ec07a1) [16] = Object (@a973301) The code: for( var i:String in obj.stats) { trace(i); } for each

Re: [flexcoders] Looping through sorted ObjectProxy

2007-04-16 Thread Bjorn Schultheiss
Hey Bjørn, for in loops in reverse. for each should give you what you need. regards, Bjorn On 17/04/2007, at 5:11 AM, bjorn - wrote: I'm getting a sorted ObjectProxy from a server. In my debugger it looks like this: obj.stats = Object (@b90e661) [51] = Object (@b90e541) [52] =