PDA

View Full Version : loadVars; Textbox; Button; Trace



waffe
February 19th, 2003, 11:27 PM
I use loadVars like;

home = new LoadVars();
homeURL = "home.txt";
home.load(homeURL);

Then I take part of the loadVars file and make it a varible;

home.onLoad = function(success) {
if (success) {
var text = eval("this.text");
home_txt = text;
}

See the last line of code, this is the only time this code will populate my textbox with the text from my home.txt.

If I erase home_txt = text; and put it in a button the listbox does
not populate, and if I run a trace command on home_txt it come out undefined.

So what am I doing wrong?

waffe
February 20th, 2003, 12:51 AM
Change this line of code from;

var text = eval("this.text");

TO

text = eval("this.text");

and all is working.

By chance if anyone has some time on there hands, I would love to know why this is?