In AS3, Array.sort() took some nice sorting options like:
- Array.DESCENDING – sorts the array big to small
- Array.RETURNINDEXEDARRAY – returns an array of indices so you can track which item got sorted where
But sadly Vector<T>.sort() does not support these features, and simply takes a compareFunction:Function argument so you can write your own sorting logic.
Is there any other way to quickly get a sorted indexed-array of a vector?
RETURNINDEXEDARRAYdoes not work in Flash Player 10+. It just returns the same originalVector<Number>.Unlike an Array,
RETURNINDEXEDARRAYoption is ignored for theVector.sort()method. The returned Vector object is always the reference of the original object.