# Loading variables

**URL:** <https://forum.kirupa.com/t/loading-variables/59517>\
**Category:** Uncategorized\
**Created:** [August 1, 2004, 4:57pm UTC](https://forum.kirupa.com/t/loading-variables/59517 "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/59517/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:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2004, 9:23pm UTC](https://forum.kirupa.com/t/loading-variables/59517/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.
