RE: [SPAM] [flexcoders] XMLList question
Sent from my Windows MobileĀ® phone. -Original Message- From: Tracy Spratt tr...@nts3rd.com Sent: Thursday, December 10, 2009 11:45 PM To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Subject: RE: [SPAM] [flexcoders] XMLList question I don't believe you can sort an xmllist directly. I use a function that takes the children of a node (XMLList), wraps it in an XMLListCollection, sorts it, then uses setChildren() to re-assign the sorted children to the parent. I think I have posted that here actually. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of invertedspear Sent: Tuesday, December 08, 2009 5:46 PM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] XMLList question Is it possible to sort an XMLList? All the examples I can find on it create a new XMLListCollection like this: MyXMLListCol = new XMLListCollection(MyXMLList); I don't think the XMLListCollection in this case has any reference to the XMLList so sorting it would leave my XMLList unsorted, is this correct? How can I sort the XMLList directly? Thanks ~Mike
Re: [SPAM] [flexcoders] XMLList question
I forgot I asked that question here too. I actually turned up a pretty simple function some dude developed to sort XML at http://freerpad.blogspot.com/2007/07/more-hierarchical-sorting-e4x-xml-for.html I then modified it a bit to do what I need and posted it here http://stackoverflow.com/questions/1869964/flex-newbie-xmllist-question. It's essentially the same thing as your suggesting but I couldn't use the set children easily since I had multiple note names and I only wanted to sort one. ex: question answer sort=1/ answer sort=3/ answer sort=2/ defaultAnswer/ /question I only need to (and only can) sort answer nodes but need to keep the defaultAnswer around. Thanks for the help though, sorry I didn't post the answer I had found sooner. --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: I don't believe you can sort an xmllist directly. I use a function that takes the children of a node (XMLList), wraps it in an XMLListCollection, sorts it, then uses setChildren() to re-assign the sorted children to the parent. I think I have posted that here actually. Tracy Spratt, Lariat Services, development services available
RE: [SPAM] [flexcoders] XMLList question
I don't believe you can sort an xmllist directly. I use a function that takes the children of a node (XMLList), wraps it in an XMLListCollection, sorts it, then uses setChildren() to re-assign the sorted children to the parent. I think I have posted that here actually. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of invertedspear Sent: Tuesday, December 08, 2009 5:46 PM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] XMLList question Is it possible to sort an XMLList? All the examples I can find on it create a new XMLListCollection like this: MyXMLListCol = new XMLListCollection(MyXMLList); I don't think the XMLListCollection in this case has any reference to the XMLList so sorting it would leave my XMLList unsorted, is this correct? How can I sort the XMLList directly? Thanks ~Mike