# Dynamic Button Problem

**URL:** <https://forum.kirupa.com/t/dynamic-button-problem/47570>\
**Category:** flash\
**Created:** [April 5, 2004, 9:29am UTC](https://forum.kirupa.com/t/dynamic-button-problem/47570 "2004-04-05T09:29:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbeetles](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@lbeetles](https://forum.kirupa.com/u/lbeetles)\
**Post date:** [April 5, 2004, 9:29am UTC](https://forum.kirupa.com/t/dynamic-button-problem/47570/1 "2004-04-05T09:29:00Z")

</div>

Hi all i hope someone can help me.

I am doing a project for a CD presentation, and im trying to do it as dynamic as possible. I have a few buttons on the main interface, and the text for the buttons are loading from a txt file on the CD. What i want to do is have a variable in the txt file “y” or “n” so that if the button is not needed then i can hide it. I have got a dynamic text box on the root, to pick up the y or n and then what i want is if the text box says “y” then the button is visible if it says “n” then button is not. Here is the code i have so far.

```auto

myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
   //to load the text	
   _root.play_btn.play_txt.text = this.play
   //to load the var y or n	
   _root.playbtn_txt.text = this.playbtn
};
//to load the text file with the vars
myLoadVars.load("text/labels.txt");

//playbtn_txt = dynamic text box to pick up "y" or "n".
//play_btn = the button i want to show or hide.
if (_root.playbtn_txt.text = y){
		_root.play_btn._visible = true;
	} else {
		_root.play_btn._visible = false;
}

```
