# Variable Issue

**URL:** https://forum.kirupa.com/t/variable-issue/247052
**Category:** flash
**Created:** [December 18, 2007, 2:35am UTC](https://forum.kirupa.com/t/variable-issue/247052 "2007-12-18T02:35:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thegrrraue](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@thegrrraue](https://forum.kirupa.com/u/thegrrraue)
#### Post date: [December 18, 2007, 2:35am UTC](https://forum.kirupa.com/t/variable-issue/247052/1 "2007-12-18T02:35:36Z")

</div>

I’m having a little trouble with a presentation I’m working on.

I’m creating a presentation that will, depending on user inputs, change which frames are shown. To do this, I created a dynamic text box to load a text file, hoping to then pass whatever comes up there on to an if/else statement that would determine the appropriate action.

The text is loading into its dynamic text box just fine, but it doesn’t appear to pass along to the if/else statement as even when “if” is true, it performs the “else” action.

Here is the code:

loadText = new LoadVars();  
loadText.load(“cambtn.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
cambtn.html = true;  
cambtn.htmlText = this.text;  
}  
};

The above is on a frame with a dynamic text box with an instance name of “cambtn.”

The variable name for this text box is “cambutn” (I changed it slightly as at one point I theorized that perhaps having them both named the same was screwing things up). Then on the frame that determines where the presentation goes next:

if (cambutn == “4”) {  
\_root.gotoAndStop (4);}  
else {  
\_root.gotoAndStop (5);}

“4” is, in fact, what’s being loaded into cambtn, and yet the movie is still going to the root’s 5th frame. Where did I go wrong?
