Hello! I’m trying to load multiple data from a text file.
EJ. subt.txt
1=Hello world
2=hello mom
3=hello son
I already make it to find the subt.txt using variables on my website. Now I need two more things.
I need it to select the value from the subt.txt using the [COLOR=black]“tour”[/COLOR] variable.
EJ. If the actual var is 2 then it would display “hello mom”
Heres is what I made so far.
_global.[COLOR=red]tour[/COLOR] = “1” //Tour
_root.gal.pics.pic.loadMovie(“data/trips/”+seccion+"/img/"+[COLOR=red]tour[/COLOR]+"/"+qty+".jpg");
myLoadVar = new LoadVars ();
myLoadVar.load(“data/trips/”+seccion+"/img/"+tour+"/subt.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
subt.text = myLoadVar.[COLOR=red]tour[/COLOR]; // Tour is the var I want to use
}
}
I got: (undefined) What I need is that it reads the var from the [COLOR=black]subt.txt[/COLOR] and display it’s content. AKA
1=Hello world
2=hello mom
3=hello son
Thnks for your time.