Workflow Example
Having discussed how the Flash Player and the Flash Remoting gateway communicate, now let’s look at what occurs behind the scenes. We will examine each step of the earlier Hello World example. In Example 1-1, a remote service was called from Flash and received a “Hello World” string in response.
Here are the steps that occur:
Using the NetServices API within Flash, developer-written code makes a call for a remote service.
The NetServices library passes the remote service call, along with any arguments, to the NetConnection object within the Flash Player.
The NetConnection object serializes the request into AMF and sends it to server as an HTTP binary
POST.The Flash Remoting gateway on the server receives the request, deserializes it and determines the server-side service to which to pass the request.
The Flash Remoting gateway on the server invokes the server-side service, passing any arguments sent along with the request from the Flash Player.
The Flash Remoting gateway on the server receives any data returned from the service (in this case, the string “Hello World”), serializes it into AMF, and returns it to the client-side Flash Player as an HTTP response.
The Flash Player receives the AMF data from the server and deserializes it into a native ActionScript datatype (in this case a String object). Depending on the data sent back, the deserialization is done within the Flash Player or the NetServices code.
Finally, the string is returned to an ActionScript callback function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access