Question about reaching data i loaded through XML -as3

i cant reach my data - i loaded it with:


var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(new URLRequest("gallery.xml"));
var infoXML:XML;

function xmlLoaded(evt:Event):void{
	infoXML = new XML(xmlLoader.data);
}

i know it is working because rollover a button with :


var targetNumber:Number;
function btn_Roll(event:MouseEvent):void{
	targetNumber = event.currentTarget.name.slice(4,6);
	rollClip_mc.roll_txt.text = infoXML.city.title[targetNumber];
}

so i know infoXML.city.title[targetNumber];reaches the data i want, and for what i understand infoXML is like an Array.
but if i try to call it from another place it gives me an error or null.
so i dont know how i can reach the data??

Are you accessing it from the other place before it has had time to be parsed?

thank you! you were right…