Array has no field sortOn()

Hello,

How to use Array.sortOn() in OpenFl :

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

Thanks

Maybe this helps

You need to use the https://api.haxe.org/haxe/ds/ArraySort.html 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:
sprites.sort(youCustomSortFunction);

Thanks, ArraySort.sort() work.