# Dinamic VAR with ActionScript

**URL:** https://forum.kirupa.com/t/dinamic-var-with-actionscript/188592
**Category:** flash
**Created:** [May 9, 2006, 8:50am UTC](https://forum.kirupa.com/t/dinamic-var-with-actionscript/188592 "2006-05-09T08:50:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![blueworks](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@blueworks](https://forum.kirupa.com/u/blueworks)
#### Post date: [May 9, 2006, 8:50am UTC](https://forum.kirupa.com/t/dinamic-var-with-actionscript/188592/1 "2006-05-09T08:50:25Z")

</div>

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.tx** t 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.
