# Button.\_visible with LoadVars

**URL:** <https://forum.kirupa.com/t/button--visible-with-loadvars/122829>\
**Category:** Uncategorized\
**Created:** [September 17, 2004, 1:40pm UTC](https://forum.kirupa.com/t/button--visible-with-loadvars/122829 "2004-09-17T13:40:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![guyute](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/guyute/32/763_2.png) [@guyute](https://forum.kirupa.com/u/guyute)\
**Post date:** [September 17, 2004, 1:40pm UTC](https://forum.kirupa.com/t/button--visible-with-loadvars/122829/1 "2004-09-17T13:40:07Z")

</div>

I’m working on a site that has dynamically loaded text menu loaded with the following action:

myData = new LoadVars();  
myData.load(“menu/menu01.txt”);  
myData.ref = this;  
myData.onLoad = function(succes) {  
if (succes) {  
for (var i = 0; i\<this.cant; i++) {  
this.ref[“title\_txt”+i].htmlText = this[“Title”+i];  
this.ref[“link”+i].htmlText = this[“link”+i];  
}  
} else {  
trace(“Error loading data”);  
}  
};

which loads this text from menu/menu01.txt:

Title0=TITLE HERE &link0=FIRST LINK&link1=SECOND LINK&link2=&link3=&link4=&link5=&link6=&link7=&link8=&link9=&link10=&link11=&link 12=&link13=&link14=&cant=15

what i would like to know, since this is new to me, is can i have a button instance on the stage under each variable from menu01.txt, and set the buttons to \_visible=true; or \_visible=false; depending on wether or not there was text loaded in the dynamic text field? also, how can i get flash to recognize wether or not text was loaded or not loaded if the var is empty?

thanks.
