# Custom size for an array from an external file

**URL:** https://forum.kirupa.com/t/custom-size-for-an-array-from-an-external-file/209421
**Category:** Uncategorized
**Created:** [December 8, 2006, 4:42pm UTC](https://forum.kirupa.com/t/custom-size-for-an-array-from-an-external-file/209421 "2006-12-08T16:42:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Krystar](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@Krystar](https://forum.kirupa.com/u/Krystar)
#### Post date: [December 8, 2006, 4:42pm UTC](https://forum.kirupa.com/t/custom-size-for-an-array-from-an-external-file/209421/1 "2006-12-08T16:42:05Z")

</div>

I have a problem where I have a flash file that constantly loops. It reads 3 different variables from a txt file and outputs their data. I also have it refreshing the swf so that when I change data in the .txt file it updates it realtime in the swf without having to reload the file. but what I also need is a way to tell it to make an array a certain length to populate this data. And instead of a fixed size as it is right now, to make it X long where X is declared in the .txt file that i am using.

here is the code that im currently using:

```auto
loadVariablesNum("childdata.txt", 2);
imageNum = 0;
Ext = "image";
imagelist = new Array(ArreySize);
for (i = 0; i < ArreySize; i++)
{
    imagelist* = Ext + (i + 1) + ".jpg";
} 

```

and ArreySize is set to “3” right now for testing purposes.  
my .txt file looks like this:

&test= true  
&length= 3  
&pic0= Julie Smith  
&test0= 2  
&check0= 3  
&pic1= Jane Smith  
&test1= 5  
&check1= 6  
&pic2= John Doe  
&test2= 8  
&check2= 9

now there is more code to it, but thats the code that i need to get the length variable from the .txt file and add it to the array size.  
This thing is driving me bonkers. ive been working on this project for 2 days already.

ANY help would be greatly appreciated.

and i dont know if its important but im using flash 8 professional
