Ruby script converting to Haxe3 from AcrionScript3