As alternative to
Map<String, Dynamic> there is also
haxe.DynamicAccess, see https://haxe.org/manual/types-dynamic-access.html and try it here https://try.haxe.org/#c23B6
More an advice than answer, but in general it’s better to avoid mixing types like you do with
Map<String,Dynamic>. This is because you lose the advantages of type checking. You don’t want to lose this because the code will be more error prone, and Haxe cannot help you with that. Most things you resolve with “Object” can also be solved in a more type-safe way, which could also results in better performance.
Example. Let’s say you have this:
var map:Map<String, Dynamic> = ["key1" => 123, "key2" => "hello"];
and then do
trace(map["key1"].toLowerCase()) that results in a runtime error. It is of course possible to "solve this with
if(Std.is(map["key1"], String) but that will add all sorts of runtime type-checking in your code. If you look it at this way; you are replacing what the Haxe compiler should do for you, with some own checks. Ideally you strive for compile time errors to solve things before they are even executed.
Hope this somehow helps.