I see. So shall I read your response as:
Flex asynchronous methods get queued up and are only invoked once ALL
synchronous calls in the same block get executed.
So I were to have the following:
var asyncToken:ASyncToken
public function callServer():void
{
asyncToken= httpsrv.send();
}
public function doit():void
{
callServer();
asyncToken.addResponder(...);
}
<mx:button click="doit()"/>
So, in this case, my chances of it working are reduced... (not the 100%
anymore). Is that right?
thks.
--- In [email protected], "Adnan Doric" <astrona...@...> wrote:
>
> The key word is "asynchronous".
>
> "httpsrv.send()" is asynchronous so it gets executed after all synchronous
> statements (addResponder is synchronous) in the same block.
>
> cheers,
> Adnan
>
> --- In [email protected], "Mehdi" <elextraana@> wrote:
> >
> > This is a question that has been bothered me for some time.
> > You know how in Flex you can invoke a service (say httpservice for
> > instance) which returns a token. After that you set the responder on the
> > token. I.e.:
> >
> > var asyncToken:ASyncToken = httpsrv.send();
> > asyncToken.addResponder(...)
> >
> > We set the responder/handler AFTER the call has been set. Its very awkward
> > but it does work. I was hoping someone could explain this to me. Thank you.
> >
> > Flex being single threaded, the call to httpsrv.send() should actually
> > invokes the server and not get into the second line about the responder
> > until the call has been at least issued.
> > But that's not how it works I guess. So, I am assuming the call is queued
> > somewhere, until....until when???
> >
> > Cheers
> >
>