Variables dissappear on entering new frame [renamed]

Hi there, i have a little problem. I have the code below, which loads in from an xml file and makes buttons and sets variables, but when we enter a new frame for somereason the variables dissapare. how can i fix this?

//
//hide the original button
this.button_mc._visible = false;
//set the starting Y position from the first button
Ystart = this.button_mc._y;
//
//create the Array
files = new Array();
//
//create the XML
var XMLreciever = new XML();
XMLreciever.ignoreWhite = true;
//onLoad Function
XMLreciever.onLoad = function(success:Boolean) {
    if (success) {
        //loop thru the <buttons> nodes in the XML
        for (i=0; i<this.firstChild.childNodes.length; i++) {
            //enter the current name attribute of the <buttons> node into the files array
            files* = this.firstChild.childNodes*.attributes.name;
            //
            //duplicate the button on the stage
            duplicateMovieClip(_root.button_mc, "button_"+i, i);
            //set the Y position of the new button
            _root["button_"+i]._y = Ystart;
            //Incremement the Ystart variable for the next button
            Ystart += 35;
            //set the text on the button
            _root["button_"+i].textbox.text = files*;
            //set the image variables
            _root["button_"+i].image1 = this.firstChild.childNodes*.childNodes[0].firstChild.nodeValue;
            _root["button_"+i].image2 = this.firstChild.childNodes*.childNodes[1].firstChild.nodeValue;
            _root["button_"+i].image3 = this.firstChild.childNodes*.childNodes[2].firstChild.nodeValue;
        }
    }
};
//load xml file
XMLreciever.load("images.xml");

files located at http://www.zedcom.co.nz/movie3.zip

Thanks
Mattzi

The file you linked was a mess, i didn’t even bother going through it cause I had no idea where to find the AS that you were having the problem with. But i’m pretty sure you just have to put **_root **right before where the FOR loop inside the IF(success) check assigns the image paths inside the XML file to a variable with the FOR loop number.

EXAMPLE

This :
image* = xmlnode.childnode*.childnode[1].nodeValue();

Turns to this :
_root.image* = xmlnode.childnode*.childnode[1].nodeValue();

Then again, i’m not 100% sure if it’s going to work so don’t bank on me knowing what i’m talking about (-: