Array has no field sortOn()


How to use Array.sortOn() in OpenFl :

var sprites:Array = [sprite1, sprite2, sprite3];
sprites.sortOn("x", Array.NUMERIC | Array.DESCENDING);


Maybe this helps

You need to use the class. Either call it directly:
ArraySort.sort(sprites, yourCustomSortFunction);

or via adding:
using haxe.ds.ArraySort;
at the top of the package.

and then it will add the sort function to the array so you can do:

Thanks, ArraySort.sort() work.