# \[FLMX04\] Creating Multiple Variables from a Txt File

**URL:** <https://forum.kirupa.com/t/flmx04-creating-multiple-variables-from-a-txt-file/194066>\
**Category:** flash\
**Created:** [July 20, 2006, 7:59am UTC](https://forum.kirupa.com/t/flmx04-creating-multiple-variables-from-a-txt-file/194066 "2006-07-20T07:59:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aix](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Aix](https://forum.kirupa.com/u/Aix)\
**Post date:** [July 20, 2006, 7:59am UTC](https://forum.kirupa.com/t/flmx04-creating-multiple-variables-from-a-txt-file/194066/1 "2006-07-20T07:59:47Z")

</div>

I am trying to create multiple variables from quite a big NOTEPAD / Txt file that would be constanly changing.

The notepad file would look something along the lines of:

> 

[LEFT]heading1=Hello!&heading2=How r u?&heading3=Great Day… … &heading50=WOOT!!![/LEFT]

etc.

I am trying to generate multiple variables in Flash MX 2004 for each of those “headings”

In Flash I’ve tried things along the lines of:

> 

loadTxt = new LoadVars();  
loadTxt.load(“headings.txt”);  
loadTxt.onLoad = function() {  
for (i=1; i\<50; i++) {  
heading\* = this.heading\*  
}  
};

but the variables never seems to register (i make dynamic txt boxes and give them variable names like: heading1, heading 2 etc.).

Also, the only reason I had “i\<50” is because I don’t know how to make the function stop looping when it gets to a heading that doesn’t exist, so, um, how would you make it stop when it reaches a non-existent heading or the end of the text file?

Thanks Heaps! 😃
