What's happening when I use for(i in object) in AS3?
问题 To iterate over the properties of an Object in AS3 you can use for(var i:String in object) like this: Object: var object:Object = { thing: 1, stuff: "hats", another: new Sprite() }; Loop: for(var i:String in object) { trace(i + ": " + object[i]); } Result: stuff: hats thing: 1 another: [object Sprite] The order in which the properties are selected however seems to vary and never matches anything that I can think of such as alphabetical property name, the order in which they were created, etc.