Making a variable available outside a function

Basically I’m trying to load a variable from an external file and then make that variable available for anything.


var where;
locSource = new LoadVars ();
locSource.load("source.txt");
locSource.onLoad = function () {
    where = this.loc;
}
trace (where);

I’ve tried all the variations of this I can think of. I’ve defined “where” as a global variable both outside and inside the function, tried to define a separate global value within the function (and changed the syntax of the trace accordingly in either case), nothing works. Basically, the function is being loaded properly; if I put the trace inside the function it shows up perfectly, but the variable isn’t available for anything else, which is what I need to happen. Any ideas?