Hi guys. I want to dispatch a custom event when the two files are downloaded or uploaded successfully. I use
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileBigRef.addEventListener(Event.COMPLETE, completeHandler);
to listen the complete event with only 1 handler.
function completeHandler(event:Event):void{
var e:Event=new Event("addInfoDone");
dispatchEvent(e);
fileBigRef.removeEventListener(Event.COMPLETE,completeHandler);
fileRef.removeEventListener(Event.COMPLETE,completeHandler);
}
I want the event to be dispatched only once when both of the fileRef and fileBigRef are complete transfered. Any ideas?? My brain is fry now and can't think of anything..... Thanks for the help.