modified for haxe 2.10 & nme 3.5.5