30
Chapter 2: Using Flash Remoting ActionScript
Note:
Flash Remoting applications require that Macromedia Flash Player 6 (6.0.79.0), or later, is
installed in the client browser. For information on how to detect the version of Flash Player that a user
is using and how to respond accordingly, see Configuring publish settings for Flash Player detection
in Using Flash Help. For additional information on ensuring that the correct version of Flash Player is
installed on the client’s computer, see the Flash Remoting Support Center on the Macromedia
website at
www.macromedia.com/support/flash/flashremoting.
For information on handling Flash Remoting data, and particularly record sets, using
ActionScript, see
Chapter 4, “Using Flash Remoting Data in ActionScript,” on page 63
.
Flash Remoting application structure
Using Flash Remoting to call an application service is similar to calling a web service or making a
remote procedure call (RPC). In each case, you make a call in your program to some remote
service and you get a response from the service. As with web services and RPCs, data from the
remote service is converted from the native data type of the remote service (such as a Java or C#
data type) to a representation that is used to transfer the data over the network.
Unlike an RPC or web service request, a call made using Flash Remoting does not directly receive
the results of the service. Instead, you write a result-handler callback routine to handle the
returned data. Because the remote service call and the callback routine are separate, your service
call and result handling are asynchronous. In other words, the service request is like a function call
without a return, and the service result or response is like a Flash event, for which you write an
event handler method. The following figure shows this relationship:
To interact with application servers using Macromedia Flash Remoting, do the following in
your Flash application:
1.
From the Window menu in Flash, select Other Panels > Common Libraries > Remoting.
2.
From the Library panel, drag the RemotingClasses library onto the Stage.
3.
To use the NetDebug class and the NetConnection Debugger, you must also drag the
RemotingDebugClasses library to the Stage.
4.
In the Actions panel, import the ActionScript Flash Remoting classes.