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

70 Chapter 4: Using Flash Remoting Data in ActionScript
If a ColdFusion page or CFC returns a numeric value without specifically identifying the value as
numeric, Flash Remoting treats the value as a string when passing it to the responder. For
example, if you have the following user-defined function and ActionScript code, Flash displays
22, not 4, in the trace message:
ColdFusion
<cffunction name="getNumber"access="remote">
<cfreturn 2>
</cffunction>
ActionScript
function getNumber_Result (result)
{
myVar = (result + 2);
trace (myVar);
}
To prevent such problems, do either of the following:
• Specify the returnType="numeric" attribute in the cffunction tag, as in the following
example:
<cffunction name="getNumber" access="remote" returnType="numeric">
<cfset foo = 2>
<cfreturn foo>
</cffunction>
• Use the Val function to explicitly convert the value to a number before you return it, as in the
following example:
<cffunction name="getNumber" access="remote">
<cfset foo = Val(2)>
<cfreturn foo>
</cffunction>
If you call either of these getNumber() functions from Flash, the ActionScript
getNumber_Result() function in the previous example displays the value 4.
About working with objects
When you pass a Flash object in a service function call, the object’s properties are sent to the
gateway. In Java environments, an instance of the
flashgateway.io.ASObject class (which
implements java.util.Map) represents a Flash object. In .NET environments, an instance of the
FlashGateway.IO.ASObject class (which implements the ICollection interface) represents a
Flash object. Therefore, you can pass Flash objects to any service function that accepts a Map or
ICollection argument.
Because Flash Remoting transmits data only, the object methods are not available on the server.
Similarly, the object properties must be data types that Flash Remoting can handle. For example,
you cannot include a Flash RecordSet object in an object that you pass to a service function,
because Flash Remoting cannot convert the RecordSet object to a data type on the server.