# XML Problem

**URL:** <https://forum.kirupa.com/t/xml-problem/306939>\
**Category:** Uncategorized\
**Created:** [March 24, 2010, 9:44pm UTC](https://forum.kirupa.com/t/xml-problem/306939 "2010-03-24T21:44:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fhavio](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@Fhavio](https://forum.kirupa.com/u/Fhavio)\
**Post date:** [March 24, 2010, 9:44pm UTC](https://forum.kirupa.com/t/xml-problem/306939/1 "2010-03-24T21:44:04Z")

</div>

Hi there i tried onw of the methods that i saw in a post in here, but the problem is to return that value…

var xmlLoader:URLLoader = new URLLoader();  
xmlLoader.addEventListener(Event.COMPLETE, DATAXML);  
xmlLoader.load(new URLRequest(“galeria.xml”));

function DATAXML(e:Event):void {  
var xmlData:XML=new XML(e.target.data);  
}

function DATAXML2(id:Number):Function {  
return function(e:Event) : void {  
var xmlData:XML=new XML(e.target.data);  
globais.vrb.nome = xmlData.pic[id].image[0];  
trace (globais.vrb.nome); \<-------- HERE THE OUTPUT IT’S OK  
}  
}

xmlLoader.addEventListener(Event.COMPLETE, DATAXML2(globais.vrb.num\_i));

trace (globais.vrb.nome); \<---- HERE THE OUTPUT IS UNDEFINED

“globais.vrb.[other]” \<— is my global object to make a global variable…

Say something i’m stuck…

Or give me another way to make this…:pac:

PS: Someone can give me some tutorial to understand much better the functions i’m confusing in using them, and passing event types, too many things… i understand functions the problem is AS3 is very complex…
