# Problem loading variable from external file

**URL:** <https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866>\
**Category:** Uncategorized\
**Created:** [October 24, 2003, 4:14pm UTC](https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866 "2003-10-24T16:14:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagunco](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jagunco](https://forum.kirupa.com/u/jagunco)\
**Post date:** [October 24, 2003, 4:14pm UTC](https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866/1 "2003-10-24T16:14:03Z")

</div>

hi

i have this code:  
var loadText = new loadVars();  
loadText.onLoad = function(success) {  
if (success) {  
myVar = this.myVar;  
trace(myVar);  
loadMovie(myVar add “.swf”, \_root.container\_mc);  
} else {  
trace(“Error loading data”);  
}  
};  
loadText.load(“data.txt”);

to load an external variable to load one movie, on the data.txt I have myVar=video1

my problem is that he is not loading video1.swf to container mc, but the trace to the cvariable name is correct

can someone give me a clue?

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:** [October 24, 2003, 6:07pm UTC](https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866/2 "2003-10-24T18:07:19Z")

</div>

Well, I copied and pasted the code, and it worked fine. The instance name of the movie clip is probably wrong… ? :-\

---

<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:** [October 24, 2003, 8:09pm UTC](https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866/3 "2003-10-24T20:09:45Z")

</div>

Hi, believe me , now I put the code and it works, but I spend 2 hours trying to do it and it didn´t work, that´s why i posted this.

I really can´t belive this.

---

<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:** [October 24, 2003, 8:13pm UTC](https://forum.kirupa.com/t/problem-loading-variable-from-external-file/33866/4 "2003-10-24T20:13:25Z")

</div>

LOL! Ok, glad it worked out. 🙂
