Q:

AS3 Sort a Collection of Objects? 

In AS3, how do i sort this list alphabetically?  I'm not a programming expert and i've had a hard time just figuring this out. 
var searchObject:Object = new Object();
var mapXML:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("interactive-map.xml"));
xmlLoader.addEventListener(Event. COMPLETE, parseXML);

function parseXML(event:Event):void {
    mapXML = new XML(event.target.data);
    for each (var locationElement:XML in mapXML.maplocation) {
        searchObject.locationname = locationElement.attribute("locationname");
        searchObject.category = locationElement.attribute("category");
        trace("Location Name: " + searchObject.locationname);
    }
}

A:

first you need to push elements to array/vector. 
Then you can sort array with sortOn or sort methods. 
Check sortOn/sort methods reference to find sorting options. 
var searchObject:Object = new Object();
var searchObjectArray:Array = new Array
var mapXML:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("interactive-map.xml"));
xmlLoader.addEventListener(Event. COMPLETE, parseXML);

function parseXML(event:Event):void {
    mapXML = new XML(event.target.data);
    for each (var locationElement:XML in mapXML.maplocation) {
        searchObject = new Object();
        searchObject.locationname = locationElement.attribute("locationname");
        searchObject.category = locationElement.attribute("category");
        searchObjectArray.push(searchObject);//pushing elements to array
    }
    searchObjectArray.sortOn("locationname")//sorting array
    for each ( var searchObjectElement:Object in searchObjectArray)
    {
        trace("Location name: " + searchObjectElement.locationname);//printing sorted array
    }
}

