I have a movie with six dynamic txt fields that needs to be populated with txt from external txt file. This is the code:
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