I have an error 1056 on flash target with Reflect.setProperty()
impossible to create test property on DocumentClass
class Main extends Sprite
public function new()
Reflect.setProperty(this, "test", true);
Why would you want to do that anyway? Seems like there’s probably a better / more strictly typed solution to whatever you’re trying to do.
I tried to create a typed variable but hasOwnProperty() not exist in OpenFl ?
I think you can add fields using
Reflect.setField, but beware, this makes objects dynamic and reduces performance