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…