# Read in from TXT file

**URL:** <https://forum.kirupa.com/t/read-in-from-txt-file/284890>\
**Category:** flash\
**Created:** [March 24, 2009, 6:49pm UTC](https://forum.kirupa.com/t/read-in-from-txt-file/284890 "2009-03-24T18:49:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImOnCloudNine69](https://avatars.discourse-cdn.com/v4/letter/i/ecccb3/32.png) [@ImOnCloudNine69](https://forum.kirupa.com/u/ImOnCloudNine69)\
**Post date:** [March 24, 2009, 6:49pm UTC](https://forum.kirupa.com/t/read-in-from-txt-file/284890/1 "2009-03-24T18:49:50Z")

</div>

I’m storying vars for x and y coordinants for starting and ending positions for movieclips. i wanted to store them in an external file to save space since there are over 100 MC’s and i didnt was 4 lines \* 100 MC’s. the vars are storred in an array.  
xstart[num]; ystart[num]; xend[num]; yend[num];. but if there is a more simple way or if using mysql or something works better let me know. I AM OPEN TO SUGJESTIONS

long story short, i have a .TXT file that has numbers in it, one per line. for instance:

1  
2  
3  
4  
5

what i need is a flash loop that could put each line into an array. (WITHOUT pre deffining each var name, that would NOT save me time or space in my code because i couldnt use an appropriate loop.)

while (x = 1, not at the end of the file, x++)  
{  
myArray(x) = next line in the file;  
}
