# Urgent help needed with loadvars!

**URL:** <https://forum.kirupa.com/t/urgent-help-needed-with-loadvars/194813>\
**Category:** Uncategorized\
**Created:** [July 26, 2006, 2:35pm UTC](https://forum.kirupa.com/t/urgent-help-needed-with-loadvars/194813 "2006-07-26T14:35:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chief\_wiggam](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@chief\_wiggam](https://forum.kirupa.com/u/chief_wiggam)\
**Post date:** [July 26, 2006, 2:35pm UTC](https://forum.kirupa.com/t/urgent-help-needed-with-loadvars/194813/1 "2006-07-26T14:35:39Z")

</div>

ok so here it is… fairly new to flash and cant work out why this isnt working…

I have a txt file with a variable in it. When a button is clicked the variable is loaded. then I want to load a swf movie depending on what the text is in the variable…

here is my code…

on (release) {  
loadText = new LoadVars();  
loadText.load(“file.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
\_root.fileBox = this.myFile;  
}

if (\_root.fileBox == “movie”) {  
loadMovie(“playermovie.swf”, \_root.dummy);  
} else {  
loadMovie(“playerimage.swf”, \_root.dummy);  
}  
};

Any takers!!!

cheers
