# Puting a loadVariable output into an array

**URL:** <https://forum.kirupa.com/t/puting-a-loadvariable-output-into-an-array/66209>\
**Category:** Uncategorized\
**Created:** [October 3, 2004, 11:41pm UTC](https://forum.kirupa.com/t/puting-a-loadvariable-output-into-an-array/66209 "2004-10-03T23:41:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)\
**Post date:** [October 3, 2004, 11:41pm UTC](https://forum.kirupa.com/t/puting-a-loadvariable-output-into-an-array/66209/1 "2004-10-03T23:41:12Z")

</div>

i’m writing a flash script that loads a text file, cycles through all of the variables in it, and then outputs each variable into it’s own item in an array. but i can’t get it to work and i don’t understand what the problem is. this is the code i’ve got in frame one:

```auto
quotes = new LoadVars();
quotes.load("data.txt");
quotes.onLoad = function(success) {
	if (success) {
		j = 0;
		for (i in quotes) {
			quoteArray = new Array();
			quoteArray[j] = quotes*;
			j++;
		}
	}
	loadCaption();
};
function loadCaption() {
	for (k=0; k<quoteArray.length; k++) {
		trace(quoteArray[k]);
	}
}

```

and this is what i’ve got in the text file, “data.txt”:

```auto
quote1=1&quote2=2

```

i think the problem is with the line:  
quoteArray[j] = quotes\*;  
but i don’t know what’s wrong with it.

anyone?
