Do not use loadVariables, use LoadVars.
onLoad you'll need to assign the variables loaded in the LoadVars object. Any actions that follow the loading of the variables need to be inside the onLoad handler. As so:
Actionscript Code:
var myLV = new LoadVars();
myLV.onLoad = function(success) {
if (success) {
someVar = this.varName;
otherVar = this.var2;
// actions that use these variables
}
} else {
// the vars couldn't be loaded.
}
};
myLV.load("data.txt");
More info on the LoadVars class in the liveDocs (link in my footer)
gparis