Unloading XML / Clearing Array / Scope? - Help Needed!

Hey Everyone.

I’m modifying an xml/mp3 player i built to load different song libraries.
Basically it’s for a personal site, and I want it to be able to load different projects I’ve worked on.

My problem is: I can load a different xml easily, but no matter how I go about it, it always appends the new songs instead of clearing the xml being played and loading the new one.
IE the new songs show up AFTER the ones currently loaded.

I’ve searched this forum and found a lot of useful stuff, but nothing seems to work in this particular example. I know graylensman sorted it out with populated buttons and so forth, but nothing seems to work for me.

I’ve tried clearing my nodes array ( nodes.splice(0); ), declaring it again ( var nodes:Array = new Array(); ) and declaring my xml object again to wipe it clean, so to speak.
But nothing works.

Here’s the code:

// load XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
    var nodes:Array = this.firstChild.childNodes;
    for(var i=0;i<nodes.length;i++)
    {    
        sa.push(new Song(nodes*.attributes.url, nodes*.attributes.artist, nodes*.attributes.title, nodes*.attributes.album));
    }
    playSong();
    }
xml.load("songs.xml");

// playSong function
function playSong():Void {
    s = new Sound();
    s.onSoundComplete = playSong;
    if (cps == sa.length - 1) {
        cps = 0;
        s.loadSound(sa[cps].earl, true);
    } else {
        s.loadSound(sa[++cps].earl, true);
    }
    new Tween(title_text, "_alpha", Strong.easeOut, 0, 100, 80, false);
    new Tween(album_text, "_alpha", Strong.easeOut, 0, 100, 80, false);
    title_text.text = sa[cps].title;
    album_text.text = sa[cps].album;
}


The main xml being loaded and the “playSong” function.

Then I have a button to load the new library:

this.pris_btn.onRelease = function() {
    nodes.splice(0);
    pris_xml();
    new Tween(sc_btn, "_y", Strong.easeOut, -73, 77, 40, false);
    new Tween(pris_btn, "_y", Strong.easeOut, 20, 77, 40, false);
    new Tween(bel_btn, "_y", Strong.easeOut, -31, 77, 40, false);
    new Tween(misc_btn, "_y", Strong.easeOut, -10, 77, 40, false);
    new Tween(sc_btn, "_alpha", easeOut, 80, 0, 40, false);
    new Tween(pris_btn, "_alpha", easeOut, 80, 0, 40, false);
    new Tween(bel_btn, "_alpha", easeOut, 80, 0, 40, false);
    new Tween(misc_btn, "_alpha", easeOut, 80, 0, 40, false);
}

function pris_xml() {
    var xml = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function() {
    var nodes:Array = this.firstChild.childNodes;
    for(var i=0;i<nodes.length;i++)
    {    sa.push(new Song(nodes*.attributes.url, nodes*.attributes.artist, nodes*.attributes.title, nodes*.attributes.album));
        }
    playSong();
    }
    xml.load("priscilla_songs.xml");
}

I’m thinking it could be a scope problem. I’ve tried clearing the nodes array in various places, but nothing works.
Or in a worst case scenario - it’s the ‘push’ method that’s pushing the new attributes into the array.

If anyone can help me, or point me in the right direction, I will be most grateful.

I really don’t know where to go from here.