You have to apply the sort to the ListCollection:

var s:Sort = new Sort();
s.fields = [new SortField("DisplayName")];
myXMLListCollection.sort = s;
myXMLListCollection.refresh();

--- In [email protected], "flexcoder2008" <[EMAIL PROTECTED]>
wrote:
>
> I have an XMLListCollection that I want to sort based on a particular
> node value.  All of the examples I have seen show sorting by XML
> attribute.
>
> My xml is in the following format:
>
> <Employee>
>   <FirstName>William</FirstName>
>   <LastName>Jackson</LastName>
>   <DisplayName>Bob Jackson</DisplayName>
> </Employee>
>
> I want to sort items by the DisplayName node, which will show up in a
> List control.
>
> Here's the code I've attempted (not working)
>
> var s:Sort = new Sort();
> s.fields = [new SortField("DisplayName")];
> myXMLListCollection.refresh();
>
>
> How do I sort based on a particular XML node?
>

Reply via email to