Hi Guys,

Anyone know how I loop over properties of a Class that extends "Obejct"

Here is an example of what I mean...

if I go:

var oThisObject:Object = {one:"one",two:"two",three:"Three"};

I can do this:
for(var s:String in oThisObject){
trace(s);
}

and will trace out "one,two,three"

If I create a class"
package somePackage
{

        [Bindable]
        public class MyCustomClass extends Object
        {
                public var one:String = "one";
                public var two:String = "two";
                public var three:String = "three";
        }
}

and then  have
var oThisObject:MyCustomClass = new MyCustomClass();

I can't do this:
for(var s:String in oThisObject){
trace(s);
}

and get any results...
...also the "toString" breaks...

I want to be able to do the second option as the properties on the
Class will be changed and added to, i would lke to refer to them
dynamically...

Cheers,

David

Reply via email to