# comboBox with variables

**URL:** <https://forum.kirupa.com/t/combobox-with-variables/85811>\
**Category:** flash\
**Created:** [April 7, 2005, 5:17pm UTC](https://forum.kirupa.com/t/combobox-with-variables/85811 "2005-04-07T17:17:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldgreymare](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oldgreymare](https://forum.kirupa.com/u/oldgreymare)\
**Post date:** [April 7, 2005, 5:17pm UTC](https://forum.kirupa.com/t/combobox-with-variables/85811/1 "2005-04-07T17:17:36Z")

</div>

I have a comboBox with several topic labels to choose from. The topics are listed in a txt file. This works. The data is also in a text file.  
&Topics=topic 1,topic2, topic3 etc&  
&Introduction=introduction1,introduction2,introduction3 etc&  
&introduction1=a bunch of text about intro 1&  
&introduction2=a bunch of text about intro 1&  
etc.

In the code below, the idea is that the getValue is also a variable in the txt file

```auto
stop();
myData = new LoadVars();
myData.onLoad = function(){
var ComboTopics = myData.Topics.split(",");
var ComboIntros = myData.Intros.split(",");

CBOLoadTopics.addItem("-- Choose Topic --");
	for (i=0;i<myData.Rows;i++){
 		CBOLoadTopics.addItem(ComboTopics*,ComboIntros*);
 		CBOLoadTopics.setRowCount(myData.Rows);
 		CBOLoadTopics.setSize(150)
		trace(myData.Rows);
	}
};

myData.load("topic.txt");

function loadTopics_check() {
  choice = CBOLoadTopics.getValue();
  trace(choice);
  Introduction_txt.text = myData.choice  
}
  // Check the status of the dropdown every 10 miliseconds.
setInterval(loadTopics_check, 100);

```
