To simplify the debugging of your ColdFusion code, use the
ColdFusion page or component to catch errors and return helpful error messages about the errors
to the Flash application. For example, the ColdFusion page causeError.cfm contains the following
code:
<cftry>
<cfset dev = Val(0)>
<cfset Flash.Result = (1 / dev)>
<cfcatch type="any">
<cfthrow message="An error occurred in this service: #cfcatch.message#">
</cfcatch>
</cftry>
In this example, the second
attribute of the
cfthrow
application. For more information on using the
ColdFusion MX Applications with CFML.
To handle the error in your Flash application, you create a fault handler for the
method, as follows:
import mx.rpc.FaultEvent;
//...
function causeError_Fault ( fault:FaultEvent ):Void
{
resultBox.text = fault.fault.faultstring;
}
In this example,
tag.
cfthrow
For more information on handling errors, see
on page
29.
118
Chapter 6: Using Flash Remoting with ColdFusion MX
tag fails because it causes a divide-by-zero error. The
cfset
tag describes the error; ColdFusion returns this attribute to the Flash
is a Flash text box that displays the error message created by the
resultBox
cftry
and
cftry
cfcatch
Chapter 2, "Using Flash Remoting ActionScript,"
and
tags in your
cfcatch
message
tags, see Developing
causeError()
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?