Timeline variable problem

hey guys,

ive got a problem…
im loading xml into a function and i wanna take a variable out of that function and put it on a timeline variable. How can this be done ?

this is what ive got:

…loading xml code… ->
var hey;
settingsXML.onLoad = function() {
hey = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
};
trace(hey)

thanks in advance