I'm using an HTTP request to download a image in binary format. When the downloading is complete, I want to process it, but I also want to pass the image's ID to the complete handler function... how is this done?
var loader:URLLoader = new URLLoader();
for(var i:int = 0 ; i<5; i++){
/* When completed I want to access the variable "i" */
loader.addEventListener(Event.complete, completeHandler);
loader.load(/* a url request */);
}
private function completeHandler(event:Event):void
{
/* I want to access the passed parameter "i" so
it is the same as it was when the eventListener was added, 0,1,2,3 or 4 */
}
Is this possible? Ive tried extending Event, but I want to handle a COMPLETE event
Thanks Phil