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

44 Chapter 2: Using Flash Remoting ActionScript
If you create a RelayResponder object at the time that you create a Service object, the result and
fault handling methods must handle the result and fault outcomes for all functions that you call
on that service.
Flash Remoting returns a fault event instead of a result if either of the following conditions occur:
• The Flash Remoting gateway encounters an error.
• A service function encounters an error (throws an exception).
You write fault handlers to respond to the errors, typically by displaying an error message or
logging the error information. In some cases, you might be able to include recovery code, such as
code to retry a call to a busy server, in the error handler.
For information on handling result and fault outcomes when you have connected to a service
using the deprecated NetServices class, see Appendix A, “Using NetServices and Connection
Classes,” on page 163.
Using the RelayResponder object for a service
To direct all results for a service to a single object, specify a RelayResponder object for the
responder parameter when you create the Service object. For example, the responder
parameter, which is the last parameter, of the following Service constructor specifies that the
onCustData() method is the result handler and the onCustFault() method is the fault handler
method. It also specifies with the first parameter that this object (
this) contains both methods.
// Service constructor creates RelayResponder
custService = new Service(
"http://localhost:8300/flashservices/gateway",
null,
"CustomerInfo",
null,
new RelayResponder(this, "onCustData", "onCustFault"));
// …
// Result handling method specified in RelayResponder for custService
function onCustData( re:ResultEvent ):Void {
// update customer grid
var rs:RecordSet = RecordSet( re.result );
rs.setDeliveryMode( "onDemand" );
// create columns
if( customers_grd.columnCount == 0 ) {
var col:DataGridColumn = new DataGridColumn( "ID" );
customers_grd.addColumn( col );
col = new DataGridColumn( "Active" );
col.width = 80;
customers_grd.addColumn( col );
col = new DataGridColumn( "Name" );
col.width = 100;
customers_grd.addColumn( col );
customers_grd.addEventListener( "change", onCustGrid_Change );
}
// Fault handling method specified in RelayResponder
function onCustFault( fault:FaultEvent ):Void {
// notify the user of the problem
//…