This content has been marked as final. Show 11 replies
This code will running fine...
No it's not, the result isn't a case insensitive sort.
the trace should look like:
Try the Array.sortOn() method. It was designed for this very purpose, and it saves you the trouble of writing a custom sort function:
if you're using a custom compare function, don't use the sort options. code your "option" in your custom sort function.
Is there a way to sortOn properties of array members? For instance, will the attached code work in any syntactical way?
I don't think there is, so I'm building off of the following:
kglad: I don't know how to evaluate Strings as case-insensitive...is there an operator for such?
We're in business....so now, how to evaluate strings case insensitive? Anyone?
I know this doesn't directly answer your question, but the Array.sortOn() method will work for you if you can refactor your collection array so that it includes one fewer layer of objects. In other words, if you can rewrite it like this:
var collection:Array = new Array(file1, file2, file3, file4, file5, file6, file7, file8);
then the following code will work for Flash Player 8 or later:
tolowercase! You have many nuggets of AS knowledge kglad!
I was just browsing Flexs util classes such as StringUtil, ArrayUtil, and feeling abit envious!