Tuesday, May 4, 2010

Flex Actionscript Goodness :Iterating Over Dictionary Object

import flash.utils.Dictionary

//Dictionary object is like key-value pair in Java, following is a code to iterate over //it

var myKeyValObj:Dictionary = new Dictionary()
myKeyValObj.firstName = "myfirstname"
myKeyValObj.lastName = "mylastname"

for (var name:String in myKeyValObj) {
trace ("myKeyValObj." + name + " = " + myKeyValObj[name]);
}

Done!! Hurray!!

No comments:

Post a Comment