User Guide
Table Of Contents
- Contents
- About Flash Remoting
- Getting Started
- Using Flash Remoting ActionScript
- Using the RemotingConnector component (Flash Professional only)
- Using Flash Remoting Data in ActionScript
- About Flash Remoting and data types
- Understanding Action Message Format
- Converting from ActionScript to application server data types
- Converting from application server data types to ActionScript
- ColdFusion to ActionScript data conversion issues
- About working with objects
- About working with RecordSet objects
- About working with XML
- The NetConnection Debugger
- Using Flash Remoting with ColdFusion MX
- Using Flash Remoting for Java
- About Flash Remoting for Java
- Calling Java classes or JavaBeans from ActionScript
- Calling Enterprise JavaBeans (EJBs) from Flash
- Calling servlets and JSPs from Flash
- Calling JMX MBeans from Flash (JRun only)
- Calling server-side ActionScript from Flash (JRun only)
- Handling function results in ActionScript
- Using Flash Remoting with JRun security
- Passing XML objects between Flash and Java
- Viewing Flash Remoting log entries
- Using Flash Remoting for Microsoft .NET
- Flash Remoting for Microsoft .NET
- Calling ASP.NET pages from Flash
- Making an ASP.NET page available to Flash Remoting
- Getting a reference to an ASPX-based service in ActionScript
- Invoking ASPX pages in ActionScript
- Using the Flash Remoting custom server control in ASPX pages
- Using the Flash Remoting namespace in code-behind files
- Using ASP.NET state management with Flash Remoting
- Using ASP.NET exception handling
- Using ADO.NET objects with Flash Remoting
- Displaying a RecordSet object in Flash with ActionScript
- Calling web services from Flash
- Calling ASP.NET assemblies from Flash
- Viewing Flash Remoting log entries
- Using NetServices and Connection Classes
- Index

120 Chapter 7: Using Flash Remoting for Java
About Flash Remoting for Java
Flash Remoting exposes Java objects as services that are accessible from Flash applications as
ActionScript functions that correspond to Java object methods. A Flash developer writes
ActionScript that uses the ActionScript Service class to connect to a remote Java application
server, get a reference to a service, and invoke the service’s functions.
How Flash Remoting for Java works
To transport messages, Flash Remoting uses a binary message format called Action Message
Format (AMF) delivered over HTTP and modeled on the Simple Object Access Protocol (SOAP)
used in web services implementations. AMF is smaller and faster than standard SOAP, and is
purely asynchronous and event driven. It lets you send a variety of data types, including record
sets, Java objects, primitives such as integers, strings, XML documents, references to EJBObjects,
and dates across the wire. For more information about AMF, see “Understanding Action Message
Format” on page 64.
The Flash Remoting gateway is a front controller on the Java application server that handles the
conversion of data types between ActionScript and Java.
When the gateway receives a service request, the request passes through a set of filters that handle
such things as serialization, logging, and security, before arriving at a service adapter, which
handles the service and invocation type. Flash Remoting has adapters for JavaBeans, Java classes,
EJBs, JMX MBeans, and server-side ActionScript.
Where Flash Remoting fits into the Java application architecture
A design pattern is a solution to a recurring problem. Many design patterns are used in the context
of a model-view-controller architecture, in which you separate data access functionality from the
user interface and control logic that uses that functionality.
In design pattern terminology, a Flash application that uses Flash Remoting is the view portion of
an application, much as a JavaServer Pages (JSP)-based or servlet-based front end is. Macromedia
Flash Player, running in a web browser or in stand-alone mode, is the client in which the view is
rendered. The Flash Remoting gateway is a front controller that translates interactions with the
Flash-based view into actions that server-side Java objects perform.
Using Flash Remoting, you can take advantage of common design patterns and frameworks in
which relational data is mapped to objects such as EJBs, JavaBeans, value objects, JMX MBeans,
or Java collections that are returned to the client.
In addition to using built-in data-type mapping, you can pass any serializable object from Java to
a Flash client. The Java fields of the Java instance, including private fields, are converted to
ActionScript properties on an ActionScript result object; when you work with JavaBeans, this
feature gives you access to JavaBean properties.
Two design patterns, the value object and session facade patterns, can be particularly useful with
Flash Remoting. Both patterns can reduce the number of remote method calls required in a Flash
application.