# LoadVars (MX)

**URL:** <https://forum.kirupa.com/t/loadvars-mx/29169>\
**Category:** flash\
**Created:** [August 23, 2003, 5:13am UTC](https://forum.kirupa.com/t/loadvars-mx/29169 "2003-08-23T05:13:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![naderslim](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@naderslim](https://forum.kirupa.com/u/naderslim)\
**Post date:** [August 23, 2003, 5:13am UTC](https://forum.kirupa.com/t/loadvars-mx/29169/1 "2003-08-23T05:13:16Z")

</div>

Hi All…

I am extremely frustrated…I cannot get a simple dynamic text box to load variables from an asp page and access database using LoadVars. It won’t even work with a text file…

I have attached my movie…please someone help!..I have looked high and low for a decent tutorial…but nothing. There are tuts but no examples that strictly RECEIVE data. I am not interested in sending variables but retreiving them using the LoadVars.load method

in my main timeline I have this:

myVars = new LoadVars();  
myVars.load(“news.txt”);  
\_root.newsbox.text = myVars.thenews;

I have a dynamic text box on stage that has an instance name of newsbox and a text file in the same folder as the movie…but yet nothing populates the box!!!

My text file has nothing in it except thenews=testing message

---

<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 23, 2003, 6:21am UTC](https://forum.kirupa.com/t/loadvars-mx/29169/2 "2003-08-23T06:21:03Z")

</div>

Replace your code with this:

[AS]  
myVars = new LoadVars();  
myVars.onLoad = function(success) {  
if(success){  
\_root.crap.text = this.thenews;  
} else {  
trace(“failed to load script”)  
}  
};  
myVars.load(“news.txt”);[/AS]

And your textfile should look like:

&thenews=Whatever news you want to put here.
