Xml array assignment problem


I’m trying to populate an array with info loaded in from an xml file. I’ve got the xml loading fine and I can trace everything but cannot seem to access the info outside of the function…here’s my code:

myXML.onLoad = function(success) {
	if (success) {
	} else {
		trace("xml did not load");

function populateNav(myXML) {
	var nowplayingXML = myXML.firstChild;
	var totalXML:Number = nowplayingXML.childNodes.length;
	var totalCases = totalXML;
	var spacing:Number = contentMC.itemsMC._width+10;
	var numberOfCases:Number = totalCases;
	var i:Number = -1;
	while (++i<numberOfCases) {
		var movie_title = nowplayingXML.childNodes*.childNodes[0].firstChild;
		var image_path = nowplayingXML.childNodes*.childNodes[1].firstChild;
		var link_to:Array = [nowplayingXML.childNodes*.childNodes[2].firstChild];

var imageholder:Array = [image_path];

My trace inside of the populateNav function works great…all the info is there and image_path returns all of my…image paths. So my XML is fine…what I can’t seem to do is pass that info outside of the populateNav function. My imageholder trace returns undefined. I think it’s got something to do with the fact that the imageholder trace is being performed before the xml is fully loaded…not sure what to do about that though…any help would be greatly appreciated.