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 (var value:Object in obj.stats) {
trace(value.week);
}
will output:
16
13
14
15
16
13
14
15
.. it always starts with the last, before moving to the first ..
Best regards,
Bjørn
On 16 Apr 2007 17:02:20 -0700, Bjorn Schultheiss <
[EMAIL PROTECTED]> wrote:
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] = Object (@b90e361)
[1] = Object (@b90e121)
[2] = Object (@b90e9e1)
(its week numbers linked to Objects, btw).
However, when I use for() like this:
for( var i:String in obj.stats) {
trace(obj.stats[i])
}
.. i get them in a different order (it starts with 2, then goes back to
51).
Why does for() behave this way? .. and how can I loop through them in the
order I see in my debugger?
Best regards,
Bjørn
--
========================
http://www.juicabil <http://www.juicability.com/>ity.com - flex blog
http://www.43min. <http://www.43min.com/>com - funny movies
--
========================
http://www.juicability.com - flex blog
http://www.43min.com - funny movies