# Reading of array items works until online

**URL:** <https://forum.kirupa.com/t/reading-of-array-items-works-until-online/211728>\
**Category:** flash\
**Created:** [January 4, 2007, 4:55pm UTC](https://forum.kirupa.com/t/reading-of-array-items-works-until-online/211728 "2007-01-04T16:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles\_i](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/charles_i/32/2986_2.png) [@charles\_i](https://forum.kirupa.com/u/charles_i)\
**Post date:** [January 4, 2007, 4:55pm UTC](https://forum.kirupa.com/t/reading-of-array-items-works-until-online/211728/1 "2007-01-04T16:55:25Z")

</div>

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;
