# Sorting numbers from XML (need help)

**URL:** <https://forum.kirupa.com/t/sorting-numbers-from-xml-need-help/260201>\
**Category:** Uncategorized\
**Created:** [May 13, 2008, 1:44pm UTC](https://forum.kirupa.com/t/sorting-numbers-from-xml-need-help/260201 "2008-05-13T13:44:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drawsoup](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drawsoup/32/80_2.png) [@Drawsoup](https://forum.kirupa.com/u/Drawsoup)\
**Post date:** [May 13, 2008, 1:44pm UTC](https://forum.kirupa.com/t/sorting-numbers-from-xml-need-help/260201/1 "2008-05-13T13:44:07Z")

</div>

hello everyone,

I have an XML-file which looks something like this:

\<team\>  
\<player name=“blabla” nr=“41” pos=“def” /\>  
\<player name=“blablaasd” nr=“3” pos=“off” /\>  
\</team\>

Then, i have 3 txtfields to hold name,nr and pos. What i can’t figure out is…how to sort the  
list i create according to the ‘nr’-node. So it will automatically set the player number ‘1’ as the first on the list. Any help or hint would be swell…  
(BTW, i’m working with AS2 in flash8)

cheers

mikz

---

<div class="post-metadata">

**Author:** ![Michael\_Chen](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Michael\_Chen](https://forum.kirupa.com/u/Michael_Chen)\
**Post date:** [May 13, 2008, 9:18pm UTC](https://forum.kirupa.com/t/sorting-numbers-from-xml-need-help/260201/2 "2008-05-13T21:18:52Z")

</div>

One possible solution - Retrieve the XML data and store it in an array. Then sort the array based on the **nr** value, then finally populate the list.
