User Guide

Table Of Contents
Handling errors with ColdFusion and Flash 821
null );
// Call the service causeError() method
var pc:PendingCall = CFMService.causeError();
// Tell the service what methods handle result and fault conditions
pc.responder = new RelayResponder( this, "causeError_Result",
"causeError_Fault" );
function causeError_Result(re:ResultEvent)
{
// Display successful result
messageDisplay.text = re.result;
}
function causeError_Fault(fe:FaultEvent)
{
// Display fault returned from service
trace("Error message from causeError is: " + fe.fault.description);
}
This example displays the trace message from the causeError_Fault function in the Flash
Output panel. The portion of the message that is contained in
fe.fault.description is the
portion of the message that is contained in
#cfcatch.message# in the causeError.cfm page.
Note: When you create a ColdFusion page that communicates with Flash, ensure that the
ColdFusion page works before using it with Flash.