Passing out Variables

Hi… I’m trying to pass a variable out of the ‘XML.onLoad = function() {’, but the variable keeps coming up undefined. This is what my actionscipt looks like:

XMLData.onLoad = function() {
  _global.variable = blah blah blah
}
trace(variable)

Any suggestions?