Copy link to clipboard
Copied
Take the following code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="ws.loadWSDL('someWSDL');">
<mx:Script>
<![CDATA[
private function onLoad():void
{
ws.WebMethodCall("msg");
navigateToURL(new URLRequest("someURL"), "_self");
}
]]>
</mx:Script>
<mx:WebService id="ws" load="onLoad()">
<mx:operation name="WebMethodCall"/>
</mx:WebService>
</mx:Application>
Will ws.WebMethodCall("msg"); definitely fully transmit the method call to the server before the next line is entered into? I know that the server may take time to process the call and try to resond, but that's not what I'm talking about. Will the call definitely be transmitted to the server, as in a ball being thrown from one person to another in a game of catch, before the next line of code is entered into and executed? Is there any chance whatsoever that navigateToURL may provoke a fault? Thank you.
you cannot rely on the server receiving anything from flash before (or after) navigateToURL causes your browser to redirect.
and sinious is correct: if you want to ensure that the server receives the call before your redirect use a listener for confirmation that the server received the call before executing navigateToURL.
Copy link to clipboard
Copied
that line of code will execute but the server will not receive the call before the navigateToURL executes.
Copy link to clipboard
Copied
So this could provoke a fault?
Copy link to clipboard
Copied
there's no way for anyone reading your post to determine what your call is doing and how that's related to your navigateToURL or anything else.
Copy link to clipboard
Copied
I just wanted to make sure you were saying that, even without networking issues, the server won't necessarily receive the call before the page redirects and kills the client script. I mean, I'm pretty sure that's what you're saying, but I just wanted to confirm.
Copy link to clipboard
Copied
you cannot rely on the server receiving anything from flash before (or after) navigateToURL causes your browser to redirect.
and sinious is correct: if you want to ensure that the server receives the call before your redirect use a listener for confirmation that the server received the call before executing navigateToURL.
Copy link to clipboard
Copied
Awesome, thanks, y'all. There had been a little bit of misunderstanding with the API sometime ago, and we were having to split hairs at the office over it. It was hard to find this in the documentation or bytecode or anything though. Thank you.
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
It is asynchronous for a multitude of reasons. To be sure, just do what you know. Assign a result handler and only when the server responds will you know it received the request so you can fire off your navigateToURL().
Find more inspiration, events, and resources on the new Adobe Community
Explore Now