improve Haxe3 compatibility(revisited)

Thanks for the comments from @crazysam.