Reflect.setField Sprite.x not working

Hello,

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

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

but it doesn’t work

Thanks

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… http://api.haxe.org/Reflect.html?#setProperty

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