# Simple XML Sorting

**URL:** <https://forum.kirupa.com/t/simple-xml-sorting/251980>\
**Category:** flash\
**Created:** [February 14, 2008, 3:39pm UTC](https://forum.kirupa.com/t/simple-xml-sorting/251980 "2008-02-14T15:39:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ephezius](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Ephezius](https://forum.kirupa.com/u/Ephezius)\
**Post date:** [February 14, 2008, 3:39pm UTC](https://forum.kirupa.com/t/simple-xml-sorting/251980/1 "2008-02-14T15:39:56Z")

</div>

Hello all - first post, so go easy on me 🙂 .

I am new to flash and actionscript, so I am starting out on AS3, with no experience in AS2. I have worked with other programming languages, so AS3 isn’t giving me too difficult of a time as I am learning…

Anyway, I am creating a program that generates a report from XML. I am having no problems displaying the data in text boxes, but I am having CRAZY problems trying to figure out how to sort by a category! I have been searching for over a week and have read countless posts, but I always run into one of two problems:

[LIST=1]  
[_]It’s in AS2. (This post would have been great if it was in AS3: [http://www.kirupa.com/web/xml/examples/sortedgradeslist.htm](http://www.kirupa.com/web/xml/examples/sortedgradeslist.htm)).  
[_]It’s way over my head. A lot of posts assume that you have a certain amount of prior knowledge.[/LIST]Any help you can give would be MUCH appreciated.  
Here’s my code so far:

```auto
 
var xmlString:URLRequest = new URLRequest("[www.url.com](http://www.url.com/)");
var xmlLoader:URLLoader = new URLLoader(xmlString);
xmlLoader.addEventListener("complete", init);
 
function init(event:Event):void
{
    var scoreCardData:XML = XML(xmlLoader.data);
    var parseXML = new pXML(scoreCardData);
    ParseBooks(scoreCardData); 
}
 
function ParseBooks(entryInput:XML):void 
{ 
 var repList:XMLList = entryInput.Score.Rep;
 var mgrList:XMLList = entryInput.Score.Manager;
 var atnList:XMLList = entryInput.Score.Attainment;
 var stkList:XMLList = entryInput.Score.Stacks;
 var tenList:XMLList = entryInput.Score.Tenure;
 var crtList:XMLList = entryInput.Score.RepCertification;
 var prmList:XMLList = entryInput.Score.Promotable;
 
 box1.wordWrap = false;
 box2.wordWrap = false;
 box3.wordWrap = false;
 box4.wordWrap = false;
 box5.wordWrap = false;
 box6.wordWrap = false;
 
 box1.autoSize = "left";
 box2.autoSize = "center";
 box3.autoSize = "center";
 box4.autoSize = "center";
 box5.autoSize = "center";
 box6.autoSize = "center";
 
 box1.htmlText = repList;
 box2.htmlText = mgrList;
 box3.htmlText = atnList;
 box4.htmlText = stkList;
 box5.htmlText = tenList;
 box6.htmlText = crtList;
}

```

Thanks,  
Ephezius
