PDA

View Full Version : catch all properties inside an ArrayCollection


WaZz
11-10-2008, 07:28 PM
Is there a way of doing that ?

I would like to loop through an ArrayCollection item, and retrieve all properties that it has. Not the value, just the property name

fnx
11-10-2008, 10:28 PM
Hello, this


import mx.utils.ObjectUtil;

var obj :Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" };
var info:Object = mx.utils.ObjectUtil.getClassInfo(obj);

for each(var objProp:Object in info.properties)
trace(objProp.localName);

should trace:

name
age
ssnum

Hope this helps :)

WaZz
11-11-2008, 02:57 PM
thank you :)