Reflect.setField Sprite.x not working


I try to change x property using Reflect.setField()

Reflect.setField (this.sprite, "x", 200);

but it doesn’t work


Why not simple?
sprite.x = 200;

You should use setProperty /

Reflect.setProperty(this.sprite, “x”, 200);

It work, why is not documented in class Reflect ?

Good question, it is part of the Haxe API docs…

It’s because Haxe getters and setters are not real fields, it actually is “get_x” or “set_x”