Building Flash-based websites using Adobe Flex - Lesson 6/10
Building Flash-based websites using Flex
Lesson 6 – Remote Server Communication
● Remote data communication
● Real-time communication
● Asynchronous communication
● HTTP Get/Post
● Flash remoting
Remote Data Communication
● Flex offers many ways to communicate data to and from a remote server.
● The first step is to determine whether a real-time (synchronous)
communication or a “request-response” (asynchronous) communication is
● Real-time communication is harder to implement.
● Need to use sockets to establish permanent connection. Many companies
block socket connection as part of their system security measures.
● In Flex, real-time communication requires Adobe's Real Time Messaging
● To use RTMP, requires Adobe's LiveCycle ES (requires licensing) or BlazeDS
(open source), both implemented on the J2EE platform.
●Used mostly in video conferencing app, or instant messaging. e.g. Yahoo
Web Messenger was done in Flex
● Make use of the HTTP/HTTPS protocol
●Connection to a remote server is achieved either thru the REST or SOAP
● REST method:
● HTTP Get/Post – HTTPService class
● Flash remoting – RemoteObject class
● SOAP method:
● Web service – WebService class
● Use the HTTPService class.
● Most web APIs use the HTTP Get/Post method
● More secured.
● Convenient the Flex application can simply call a function on the server side,
known as Remote Procedure Call (RPC) or Remote Method Invocation (RMI).
● Adobe came out with a format to support binary data transfer to be used in
conjunction with Flash Remoting, called the Action Message Format (AMF).
● Both LiveCycle ES and BlazeDS support AMF, but that means the server
needs to run J2EE.
● For other types of application server (ASP, PHP, Ruby...etc), need to use third
● WebOrb (free, pay for support) - http://www.themidnightcoders.com/