Using Flash Remoting

Using Flash Remoting

Flash Remoting is a technology for making remote procedure calls from Flash Player to server-side services. The concept is similar to that of Web services: The client makes a request to a method that’s exposed using a server-side service. The request is serialized in a specific format, sent over HTTP (or HTTPS), and the response is likewise serialized and sent back to the client. This approach enables remote clients and services to interact to create integrated applications. Like Web services, Flash Remoting has the advantage of automatically serializing and deserializing to and from native data types.

However, there are significant differences between Flash Remoting and Web services. Following are a few of those differences:

  • Flash Remoting uses AMF (Action Message Format) as the protocol for packaging data. Although this might initially sound like yet another non-standardized, proprietary format, AMF is actually a binary form of SOAP that has a significant advantage over SOAP. SOAP packets have a lot of overhead that increases the bandwidth requirements. Over time, the extra bandwidth costs can add up. AMF can send the same amount of data in a much more compact (i.e., binary) format than its SOAP counterparts.

  • AMF is supported natively by Flash Player. In addition to its use with Flash Remoting, AMF is the format Flash Player uses for shared objects and local connections. Because AMF is supported natively in Flash Player, that means that serializations and deserializations to and from native ActionScript types is automatic and fast.

  • AMF support is not built into most server technologies. However, adding the necessary AMF gateway on the server is simple. Gateways are available for most major platforms including ColdFusion, Java, Perl, .NET, and PHP. There are even reliable and enterprise-ready open-source options available.

Understanding Flash Remoting Basics

When you want to use Flash Remoting, there are two elements that communicate: a client and a service. The service is generally a class that has been exposed so that it is available to Flash Remoting. Flash Remoting is a request-response model, which means the client must initiate all requests. The client must make all calls through an intermediary called a gateway. The gateway is a web-accessible resource on the server that is capable of accepting AMF requests, deserializing them, and delegating the requests to the appropriate services.

There are many Flash Remoting gateway products, including the following:

Each gateway has its specific installation instructions. However, after you’ve installed the gateway, the general instructions to use it are the same. The following section looks at the ActionScript required to make Flash Remoting calls. In each case, you’ll need to know the URL to the gateway resource for your server. The documentation for the specific gateway you are using will tell you what you need to know to locate the correct resource. It is always a web-accessible resource such as a page (a PHP page, a .NET page, and so on) or a servlet.

taken from Joey Lott and Danny Patterson patterns with actionscript 3 book

Yorumlar

Bu blogdaki popüler yayınlar

Nude monroe tan

Ficken Classy Pounding While Style