MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Specifications Page 12

  • Download
  • Add to my manuals
  • Print
  • Page
    / 40
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 11
This is the Title of the Book, eMatter Edition
Copyright © 2003 O’Reilly & Associates, Inc. All rights reserved.
10
|
Chapter 1: Introduction to Flash Remoting
to communicate with the Flash Player. Flash Player 7 supports SOAP directly,
but it will be late 2004 until Flash Player 7 is widely distributed.
The body of the AMF packet contains either an onResult event (i.e., response event)
or an onStatus event (i.e., error event), which are both ActionScript objects. The
Flash movie can then use the object directly, without any further parsing. Chapter 3
contains an in-depth discussion of the onStatus and onResult events.
Benefits
One of the key benefits of using Flash Remoting over XML or traditional HTML
applications is that the application server no longer needs to handle any of the pars-
ing or presentation of information. This frees resources on the server so that it can be
better equipped to deal with more complex application logic and/or more users. In
addition, session management can be handled on the client inside of the Flash movie
rather than on the server. The server still keeps track of the session, but the devel-
oper doesn’t have to jump through hoops to keep track of users who don’t have
cookies or track a user session across multiple pages. This equates to huge savings in
development time and server resources.
Why Not XML?
I’ve talked about the benefits of Flash Remoting, but why not use XML? After all,
using XML you could encapsulate all of the client/server communication within an
ActionScript object and provide a simple API to transfer complex datatypes serial-
ized with XML between Flash and the server. This would have the advantage of not
requiring a server-side gateway and would work with Flash Player 5.
The main advantage of Flash Remoting over XML is that it relieves the developer
from writing an entire layer of code on both the client and server. XML parsing is
built into many of the popular server technologies, but it is cumbersome at best.
However, Flash Remoting also has a number of additional advantages:
It automatically handles all datatype conversions between ActionScript and the
server.
It can convert multiple complex datatypes.
It seamlessly supports multiple server-side technologies and application servers.
It allows remote services and web services to be called directly from Flash with-
out requiring any additional server-side code to be written.
It provides a simple and consistent API for calling remote services and web ser-
vices from the Flash Player.
It uses AMF to serialize data, which offers better performance than string-based
serialization techniques (such as XML), even though AMF is not as widely sup-
ported as XML.
Page view 11
1 2 ... 7 8 9 10 11 12 13 14 15 16 17 ... 39 40

Comments to this Manuals

No comments