Hello! I have a problem that I’ve been unable to solve for the past 3 hours.
- I have an array of ~200 buttons.
- Each button pulls individual info from a file online:
[INDENT]
/routes/801/
/routes/802/
/routes/803/
…
[/INDENT] - My pseudocode looks something like this:
var myURLReq:URLRequest = new URLRequest("/routes/"+butNum);
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.addEventListener(Event.COMPLETE, infoLoaded);
myURLLoader.load(myURLReq);
function infoLoaded(ev:Event):void{
// Parse loaded data
}
My problem is this: Let’s say the user clicks 5 buttons. Since data doesn’t load immediately, I can’t assume infoLoaded is being called in the same sequence in which the user clicks the buttons, but I need to know which file just loaded. Is there a property I can get from ev:Event so it’ll give me the URL I used to load myURLLoader?
Any help would be greatly appreciated!