Loading multiple .txt files in a nested swf

I have a swf (loader.swf) file with multiple buttons, each which loads its own external text file into still another swf with a text box; text.swf & text_txt. This swf will be loaded into main.swf. Since there are so many buttons, I wanted to create a function which would load all the text files with this format:
function loadText(myText:String){
loader = new LoadVars();
loader.onLoad = function() {
_root.text_txt.text = this.myText;

This works when it’s hard-coded onto each button, but when the code is encapsulated in the function, I only get UNDEFINED in the text_txt box.

Thanks for any help!