I have a pre-loader code that loads all of my exteranl XML text files. When I click on a link several frames later, the appropriate file is pulled from the resulting Array and placed on the stage. It works perfectly offline, but as soon as I upload it I get random text files loaded instead of the correct one. Any ideas?
Thanks!
Code below:
//combine all the arrays into one and send it to the preloader
allText = new Array().concat(introText,textForCard1,textForCard2,textForCard3,
textForCard4,textForCard5,textForCard6);
textForContent = allText;
//text preloader starts here
var counter:Number = textForContent.length, ii:Number = 0;
for (var i:Number = 0; i<counter; i++) {
xmlToLoad = textForContent*;
this[“xmlData”+i] = new XML();
this[“xmlData”+i].load(xmlToLoad);
// Check if data loaded
this[“xmlData”+i].onData = function(src:String) {
if (src != “undefined”) {
AfterData(src, num);
}
};
}
AfterData = function (src:String) {
++ii;
if (ii<counter) {
_level0[“xmlToDisplay”+ii] = src;
} else {
_global._level0[“xmlToDisplay”+ii] = src;
//stop();
play();
}
};
//hard coded line sends #2 in this case to function that places text on stage
textForStage = _level0.xmlToDisplay2;