Using Pendingcall And Relayresponder Objects For A Specific Service Function; Using The Resultevent Class - MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Use Manual

Using flash remoting for flash mx 2004 actionscript 2.0
Table of Contents

Advertisement

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
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
For example, in the following code, the
method of the petMarketService object. The return value is a PendingCall object,
code assigns a RelayResponder object to the
the RelayResponder object specifies that
handle a result outcome and
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
object that the service function returned.
property of the PendingCall object.
responder
petMarketConn()
responder
getCategories_Result()
getCategories_Fault()
function calls the
property of
temp_pc
function is the function to
function is the function to handle a fault
property, which stores the result
result
Handling service results and errors
responder
getCategories()
. The
temp_pc
. The constructor for
45

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 and is the answer not in the manual?

This manual is also suitable for:

Flash remoting mx

Table of Contents