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

Handling service results and errors 45
mx.remoting.debug.NetDebug.trace({level:"None",
message:"There was a problem: " + fault.fault.faultstring });
}
When you specify a RelayResponder object for a service, results for all service functions are
relayed to the specified result and fault handling methods, which you must provide.
Using PendingCall and RelayResponder objects for a specific service function
After the Flash client application calls a service function, it does not stop executing to wait for the
return value; it continues to execute and specify which methods will handle the result or the fault
condition that the service function returns.
A call to a service method immediately returns a PendingCall object, which has a
responder
property. You can handle the result and fault outcomes for each service method by creating an mx.
rpc.RelayResponder object, or any ActionScript object that implements the mx.rpc.Responder
interface, and assign it to the
responder property of the PendingCall object.
For example, in the following code, the
petMarketConn() function calls the getCategories()
method of the petMarketService object. The return value is a PendingCall object,
temp_pc. The
code assigns a RelayResponder object to the
responder property of temp_pc. The constructor for
the RelayResponder object specifies that
getCategories_Result() function is the function to
handle a result outcome and
getCategories_Fault() function is the function to handle a fault
outcome.
function petMarketConn() {
petMarketService = new Service(
"http://examples.macromedia.com/flashservices/gateway",
new Log(),
"petmarket.api.catalogservice",
null,
null);
var temp_pc:PendingCall = petMarketService.getCategories("en_US");
temp_pc:responder = new
RelayResponder(this,"getCategories_Result","getCategories_Fault");
}
function getCategories_Result(result:ResultEvent){
// display successful result
myGrid.dataProvider = result.result;
}
function getCategories_Fault(var fault:FaultEvent):Void {
message_txt.text = fault.fault.description;
}
For more information on the PendingCall and RelayResponder objects, see the PendingCall class
and the RelayResponder class in Flash Remoting ActionScript Dictionary Help.
Using the ResultEvent class
A successful call to a service function returns a ResultEvent object as an argument to the result
handling method. The ResultEvent object contains a
result property, which stores the result
object that the service function returned.