This problem drove me crazy. I'd thought I'd get it in the google-verse so anyone else who runs into it can benefit from my pain.
Array.sortOn() does not seem to work when the array elements are objects derived from MovieClip. The following code demonstrates.
Simple class. "zz" property will be used to sort an array of these objects.
Same as above, but derived from MovieClip.
This code goes in frame 1 of the fla. It assumes there is a symbol in the library called "SortOnTest" which is linked to McThing.
Here's the trace output:
As you can see, the array of movieclip-derived objects is not sorted.
Even stranger: if I rearrange the second array (swap elements), then call sortOn, it forces the order to its original (incorrect) order. Weird.
If I am doing anything wrong, please let me know.
BTW, this is Flash 8. I haven't tried this in any other version.
