var array = Lambda.array(myMap);
var key = Math.floor(Math.random()*array.length);
var item = array[ key ];
Or use my stupidly simple library, http://lib.haxe.org/p/random/
Random.fromIterable( myMap )
What's the best way to get a random element out of a map?
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
var arr = Lambda.array(map); // Convert the map values into an array
return arr[Std.random(arr.length)]; // Return a random element from the arrau