DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious.
After doing some research it appears that using the for(var property:String in object) does not guarantee the enumeration order of properties, however it doesn't say anything about modifying the VALUE that property points to as changing the for...in loop. See http://stackoverflow.com/questions/618966/for-each-loop-as3-is-the-direction-guaranteed for background info.
My example is as follows:
for(var i:int = 0; i<objectArray.length; i++)
{
for(var property:String in objectArray[i])
{
objectArray[i][property] = unescape(objectArray[i][property]);
}
}
objectArray[i] has properties a, b, c, d, e, f. When I step through the code here I get c, b, d, c, a, f. Notice that I get c twice.
As a solution I can create a temp object to store the data while doing the loop on the original object, and then replace the original object with the modified data, but I'd like to know what exactly is going on.
So my question is, does the value of object property modify the looping order of the for...in construct? And if so, should it or is this a bug?