# Loading multiple vars into txt field problem

**URL:** <https://forum.kirupa.com/t/loading-multiple-vars-into-txt-field-problem/154271>\
**Category:** Uncategorized\
**Created:** [July 8, 2005, 6:06am UTC](https://forum.kirupa.com/t/loading-multiple-vars-into-txt-field-problem/154271 "2005-07-08T06:06:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossarian](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@yossarian](https://forum.kirupa.com/u/yossarian)\
**Post date:** [July 8, 2005, 6:06am UTC](https://forum.kirupa.com/t/loading-multiple-vars-into-txt-field-problem/154271/1 "2005-07-08T06:06:18Z")

</div>

I have a movie with six dynamic txt fields that needs to be populated with txt from external txt file. This is the code:

```auto
stop();
//Create the LoadVars object and load data into it
myData = new LoadVars()
myData.load("anastasio2.txt")
//Make a reference to current timeline
myData.ref = this
//Callback handler and data fetching
myData.onLoad = function(succes){
	if(succes){
		for(var i=0; i<this.cant; i++){
		    this.ref["Title_txt"+i].htmlText = "<b>"+this["Title"+i]+"</b>"
			this.ref["Comments_txt"+i].text = this["Comments"+i]
			this.ref["holder_mc"+i].loadMovie(this["Image"+i])
		}
	} else trace("Error loading data") 
}

```

Have given instance names Comments\_txt0, Title\_txt0 - Title\_txt4 and loader is present.

\*\*This is the content of the txt file:

\*\*Title0=Problem&Title1=Scary?Title2=Very Scary.Title2= Weird&Comments0=You have had an accident whilst on holiday.&Title4=more etxt to go here

Kept txt in same folder as swf, but when played no txt is loaded. What am I doing wrong? Appreciate help =)

Yossi
