# Array Problem!

**URL:** <https://forum.kirupa.com/t/array-problem/123200>\
**Category:** Uncategorized\
**Created:** [September 21, 2004, 3:14pm UTC](https://forum.kirupa.com/t/array-problem/123200 "2004-09-21T15:14:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gumby19](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gumby19](https://forum.kirupa.com/u/Gumby19)\
**Post date:** [September 21, 2004, 3:14pm UTC](https://forum.kirupa.com/t/array-problem/123200/1 "2004-09-21T15:14:35Z")

</div>

Ok, I have an external text File with a bunch of variables in it. I want to store these variables in an Array.

My code:

loadVariablesNum(“whatever.txt”, 0)  
//say we have variables in the text file called test1, test2, test3.//

myArray = new Array();  
myArray[0] = test1  
myArray[1] = test2  
myArray[2] = test3  
trace(myArray[0])

Is there any reason why this shouldn’t work?? I know the variables are loading because I can call them without using arrays, also if I just put a sting such as “hello” in myArray[0], I can trace it. Otherwise I keep getting undefined. Any help is much appreciated, this is driving me crazy! Thanks.
