# One more time: Loading Arrays from a .txt

**URL:** <https://forum.kirupa.com/t/one-more-time-loading-arrays-from-a-txt/21886>\
**Category:** flash\
**Created:** [May 27, 2003, 6:28pm UTC](https://forum.kirupa.com/t/one-more-time-loading-arrays-from-a-txt/21886 "2003-05-27T18:28:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJ\_Lex](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@DJ\_Lex](https://forum.kirupa.com/u/DJ_Lex)\
**Post date:** [May 27, 2003, 6:28pm UTC](https://forum.kirupa.com/t/one-more-time-loading-arrays-from-a-txt/21886/1 "2003-05-27T18:28:28Z")

</div>

Did a search on this. Found 26 articles. Read through most of them and still couldn’t find the answers. Tried hacking them to my particular needs but still couldn’t get it right. 🙂

I’d like to load arrays from a .txt file. This data will then be used to dynamically pick images and give info about them.

I’m setting up the array as [name,title,thumb,image,link]. Here is a variable from my artist.txt file (guessing on the formatting):

artist1=“Joe Schmoe,Work Of Art,joe\_sm.jpg,joe.jpg,[http://www.joe.com](http://www.joe.com)”

Here is the actionscript code (once again, guessing):

loader = new LoadVars();  
loader.onLoad = function() {  
\_root.importedArray = this.arrayString.split(",");  
};  
loader.load(“artist.txt”);  
name = artist1[0];  
title = artist1[1];  
thumb = artist1[2];  
image = artist1[3];  
link = artist1[4];

Any help would be greatly appreciated. 🙂

Thanks,  
Lex
