I have an event listener applied to xml loading and it is currently tracking the values โโit captures, which is good, but what I want is to return an array for me. I have the creation and return of an array from "LoadXML" (it returns an array), but I cannot get this to work with an event listener.
The event listener works fine with the LoadXML function, but I have no idea how to get the returned array to use, this is an example of how my event listener works:
xmlLoader.addEventListener(Event.COMPLETE, LoadXML());
and my guess about how I will take an array (this will not work):
var rArray:Array = xmlLoader.addEventListener(Event.COMPLETE, LoadXML());
so instead i tried the following:
xmlLoader.addEventListener(Event.COMPLETE, function():Array{
var rData:Array = LoadXML(datahere);
return rData;
}
but itโs not worth it either.
So: How to return an array from eventlistener? Thank you