Hi Experts,
Is it possible to make httpService Requests synchronous in Flex?
if yes pls tell me how to do this.
It was asked to me in an interview.
Thanks
Hi Experts,
Is it possible to make httpService Requests synchronous in Flex?
if yes pls tell me how to do this.
It was asked to me in an interview.
Thanks
Well hang on, I mean it depends - you couldn't do it in a functional way, but if we're talking strictly theoretical then you could hack something like this:
var returned:Boolean = false;
function syncService():void {
httpService.addEventListener(Event.COMPLETE, completeHandler);
httpService.send();
while (!returned) {}
return;
}
function completeHandler(e:Event):void {
returned = true;
}
I'd never use that in production and it might not even work. It's just asking for time-out errors etc - but in theory that should do it, right?