For (var i:String in... convert

Hello,

how to convert this AS3 code in OpenFl

for (var i:String in this._visualPropList) {
    c[i] = a[i];			
}

Thanks

Try:

for (i in _visualPropList) {
    Reflect.setProperty (c, i, Reflect.getProperty (a, i));
}

I have this error because visualPropList is Dynamic (Object in AS3)

You can’t iterate on a Dynamic value, please specify Iterator or Iterable

Oh, maybe:

for (name in Reflect.fields (_visualPropList)) {
    Reflect.setProperty (c, name, Reflect.getProperty (a, name));
}

and for that

for each (var t:MyClass in _visualPropList)
{
    if (t.type == params.type)
    {
        return t;
    }
}
var fields = Reflect.fields (_visualPropList);
var t:MyClass;

for (field in fields) {
    t = Reflect.getProperty (_visualPropList, field);
    if (t.type == param.type) {
        return t;
    }
}