
Fortunately, my trusted "ActionScript 3.0 Bible" has this example:
var notes:Object = new Object(); notes[“Roger”] = “Likes games”; notes[“Mims”] = “Super organized”; notes[“Ashley”] = “Enjoys drawing”; for each (var name:String in notes) { trace (“Notes on “ + name + “: “ + notes[name]); } //Displays: Notes on Roger: Likes games… etc.
But incredibly, this is the actual output:
Notes on Super organized: undefined
Notes on Enjoys drawing: undefined
Notes on Likes games: undefined
Any insight here would be GREATLY appreciated. Thanks.
If you would like to make a comment, please fill out the form below.
you’re looking for a different iteration
for (var name:String in notes)
trace (“Notes on “ + name + “: “ + notes[name]);