# Dynamic text fields help

**URL:** <https://forum.kirupa.com/t/dynamic-text-fields-help/132902>\
**Category:** Uncategorized\
**Created:** [January 3, 2005, 12:10pm UTC](https://forum.kirupa.com/t/dynamic-text-fields-help/132902 "2005-01-03T12:10:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash\_ee2](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@flash\_ee2](https://forum.kirupa.com/u/flash_ee2)\
**Post date:** [January 3, 2005, 12:10pm UTC](https://forum.kirupa.com/t/dynamic-text-fields-help/132902/1 "2005-01-03T12:10:05Z")

</div>

hi everyone am creating a dictionary of my javascripts on Flash MX am doin great creating it, i have on the stage a combo box that has the codes and am using it to load my variables threw it, i have two dynamic text fields that displays the data on one i have the codes and on the other i want to load the esplanation of what the codes does. Here is where i ran into a little problem.

here is the question: how do i load two separated files with the same loadVariables command. i hope i make sense. here i post a couple of codes.

myData = new LoadVars();  
myData.load(“codes.txt”);  
//creating the loadVarsText function

[color=Red]selectedindex = \_root.codes.getSelectedIndex();[/color]//this is my combo box i used the getSelectedIndex() to retreave a number Index from the combo. this number i used it to get the variable store in text file. now i need to know how to make so that i could load two different variables to load from different text files to display the two files in the two text fields.

myData.onLoad = function() {  
if(selectedindex == 0){  
\_root.displayArea.text = this.code1;  
}  
if(selectedindex == 1){  
\_root.displayArea.text = this.code2;  
}  
if(selectedindex == 2){  
\_root.displayArea.text = this.code3;  
}  
if(selectedindex == 3){  
\_root.displayArea.text = this.code4;  
}  
if(selectedindex == 4){  
\_root.displayArea.text = this.code5;  
}  
if(selectedindex == 5){  
\_root.displayArea.text = this.code6;  
}  
if(selectedindex == 6){  
\_root.displayArea.text = this.code7;  
}  
if(selectedindex == 7){  
\_root.displayArea.text = this.code8;  
}  
if(selectedindex == 8){  
\_root.displayArea.text = this.code9;  
}  
if(selectedindex == 9){  
\_root.displayArea.text = this.code10;  
}  
if(selectedindex == 10){  
\_root.displayArea.text = this.code11;  
}  
if(selectedindex == 11){  
\_root.displayArea.text = this.code12;  
}  
if(selectedindex == 12){  
\_root.displayArea.text = this.code13;  
}  
if(selectedindex == 13){  
\_root.displayArea.text = this.code14;  
}  
if(selectedindex == 14){  
\_root.displayArea.text = this.code15;  
}

};  
}  
sorry this was long
