Hi!
Here’s the deal: I want to load an external variable called name from a text file into a local variable in flash called my_str…here’s what I have:
var loadText = new loadVars();
loadText.onLoad = function(success) {
if (success) {
myVar = this.name;
_root.my_str = myVar;
//if I trace(_root.my_str) here I get the external text fine
} else {
trace(“Error loading data”);
}
}
loadText.load(“data.txt”);
//tracing (_root.my_str) here returns undefined
I need to have the variable my_str available outside the function…any ideas why it isn’t working???
thanx.