Array content 'undefined' in Simulate Download

One last time and then I abandon this idea of importing XML files forever :a:

I have attached a sample .fla file plus folders with the other files in the Variables not found only on “simulate download” post if you want to try running it.

There are 42 XML text files and 42 buttons on stage. In ‘Test Movie’ all 42 external XML files load perfectly every time - switch to ‘Simulate Download’ and keep clicking. It won’t take long to “break it” and an ‘undefined’ will appear. But if you keep clicking, the same text will be defined on the next time around - so this isn’t simply a case of the array not being created properly.

This is the frame in the preloader that creates the array that holds the XML files - it loops until they are all loaded - the counter is set and incremented in the other preloader frames:

function loadXML(loaded) {
    if (loaded) {
        //loops back to load all text
        var xnRootNode:XMLNode = this;        
        **myText[nCounter] = xnRootNode; **   
        gotoAndPlay(next);
    }
}

var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.load(allText[nCounter], allPics[nCounter] );
xmlData.onLoad = loadXML;

This is the line of code that gets the XML content when a button is clicked - it’s in a mc (‘stageContent_mc’) to make it available globally, therefore ‘_root.’ is in the line below. This is definitely where ‘undefined’ happens - in the code that grabs the XML content from the array, right before it’s dynamically put into the text field.

textForStage = _root.myText[textNum];

‘textNum’ will never fail to show the number clicked when ‘undefined’ appears - but ‘textForStage’ which is the actual text in the array will show ‘undefined’ in the output window.

Any ideas on how to solve this (after a year) would be GREATLY appreciated.

Thanks
Charles

P.S. Any idea why the gifs are actually not loading INTO the .fla file? There is a definite lag time when using real gifs with larger file size.)