# Loading variables

**URL:** https://forum.kirupa.com/t/loading-variables/117973
**Category:** Uncategorized
**Created:** [August 1, 2004, 4:57pm UTC](https://forum.kirupa.com/t/loading-variables/117973 "2004-08-01T16:57:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Phantom\_Lord](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@Phantom\_Lord](https://forum.kirupa.com/u/Phantom_Lord)
#### Post date: [August 1, 2004, 4:57pm UTC](https://forum.kirupa.com/t/loading-variables/117973/1 "2004-08-01T16:57:41Z")

</div>

how can i load variables from an external txt file?? for example:  
i have a txt with this values: 123 234 321  
how can i load 123 and assign it to a variable??

thanks

---

<div class="post-metadata">

### Author: ![bobdoe](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bobdoe](https://forum.kirupa.com/u/bobdoe)
#### Post date: [August 1, 2004, 9:23pm UTC](https://forum.kirupa.com/t/loading-variables/117973/2 "2004-08-01T21:23:45Z")

</div>

loadText = new LoadVars();  
loadText.load(“myTextFile.txt”);  
loadText.onLoad = function(){  
myFlashVariable = this.textVariable;  
}  
create a .txt file called “myTextFile.txt” and inside it type: &textVariable=123 234 321  
the text file has to look like that. no space between equal sign before variable. try this and tell me if it works because I havent test this code.
