I have variable “img : String” and I try ot get the value, but get empty string. Example:
class Test {
static function main() {
new Test2().me();
}
}
class Test2 {
public function new()
{
}
var img : String = "this is haxe";
public function test() {
trace(Reflect.field(this,"img"));
}
}
try.haxe.org has dead-code elimination enabled by default. img was not referenced anywhere, so it removed it. Adding @:keep to a class or field that is only referenced by reflection can help