The intrinsic for Array that shipped with 1.5 expected the second option to be the number use-case (and therefore you’re going to need to use the | operator).  You can work around this by

1)       using the | operator

2)       using a temporary variable typed as Object

3)       go edit Array.as in web-inf/flex/ system_classes to change the type of options to Object.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of João Fernandes
Sent: Wednesday, February 01, 2006 8:09 AM
To: [email protected]
Subject: [flexcoders] Array.SortOn Error (Flex 1.5)

 

Hi there,

 

I was trying to sort an array like the documentation says

 

“Flash Player 8 added the ability to specify a different sorting option for each field when you sort by more than one field. In Flash Player 8, the options parameter accepts an array of sort options such that each sort option corresponds to a sort field in the fieldName parameter. The following example sorts the primary sort field, a, using a descending sort; the secondary sort field, b, using a numeric sort; and the tertiary sort field, c, using a case-insensitive sort:

Array.sortOn (["a", "b", "c"], [Array.DESCENDING, Array.NUMERIC, Array.CASEINSENSITIVE]);”
 
But when I try this I got this error during compiling:

 

Type mismatch. Array found where Number was expected in parameter 2

 

Any toughts?

 

Thanks

 

João Fernandes

Secção de Desenvolvimento

Departamento de Informática

 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to