# ComboBox and dynamic text

**URL:** <https://forum.kirupa.com/t/combobox-and-dynamic-text/84075>\
**Category:** flash\
**Created:** [March 24, 2005, 1:30pm UTC](https://forum.kirupa.com/t/combobox-and-dynamic-text/84075 "2005-03-24T13:30:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart\_weijts](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bart\_weijts](https://forum.kirupa.com/u/bart_weijts)\
**Post date:** [March 24, 2005, 1:30pm UTC](https://forum.kirupa.com/t/combobox-and-dynamic-text/84075/1 "2005-03-24T13:30:03Z")

</div>

Hi there,  
Finally I had my comboBox working, but now the next trick, how to load dynamically text (\*.txt) into the stage when you use the comboBox. I first got the combobox working with just jumping to antother frame (gotoAndStop()), but now I inserted the loadText as and this doesn´t work, any help app.

as code I used, red text is the load text code.

myComboBoxListener = new Object();  
myComboBoxListener.change = function(eventObj)  
{var eventSource=eventObj.target;  
var theSelectedItem=eventSource.selectedItem;  
var theSelectedItemLabel= theSelectedItem.label;  
[color=red]if (theSelectedItemLabel== “year 2005”){  
loadText=new LoadVars();  
loadText.load(“2005.txt”);  
loadText.onLoad=function(){  
time.text=this.time;  
wedstrijd.text=wedstrijd.location;  
};  
[/color]}  
else if (theSelectedItemLabel== “year 2004”){  
gotoAndStop(4);}  
else if (theSelectedItemLabel== “year 2003”){  
gotoAndStop(5);}  
}  
myComboBox.addEventListener(“change”, myComboBoxListener);
