Hi Alex,
this has the same effect:
private function sortArray(array:ArrayCollection):void
{
var sort:Sort = new Sort();
sort.compareFunction = consecutiveCorrectAnswersFunction;
array.sort = sort;
array.refresh();
}
private function consecutiveCorrectAnswersFunction(a:Object,
b:Object, array:Array = null):int
{
if(a.rank == b.rank)
{
return 0;
}
if(a.rank > b.rank)
{
return 1;
}
else
{
return -1;
}
}
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Sorting-ArrayCollection-not-as-expected-tp12355p12360.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.