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

ColdFusion to ActionScript data conversion issues 69
The following is additional information on conversion from server data types to ActionScript
data types:
• If a string data type on the server represents a valid number in ActionScript, Flash can
automatically cast it to a number if needed.
• If you use the setType() method to assign an object type to a flashgateway.io.ASObject object
on the server, and the type name matches the name of a registered class in ActionScript, Flash
Remoting creates an instance of that type in ActionScript. For more information see “Working
with ActionScript typed objects” on page 71.
• To return multiple, independent, values to your Flash application, place them in a complex
server variable that can hold all the required data, such as a variable that converts to a Flash
Object, Array, or Associative Array data type. Return the single variable and use its elements in
the Flash application.
ColdFusion to ActionScript data conversion issues
ColdFusion is a loosely typed (untyped) language, where the data type of a variable can be
ambiguous. As a result, Flash Remoting cannot always determine how to convert between
ColdFusion data and ActionScript data. Boolean data in ColdFusion
If a ColdFusion page or CFC returns Boolean values, it represents these values as strings. Flash
does not have rules for converting strings to Boolean values. Instead, it converts the string to a
number, and then converts the number to a Boolean value. This operation converts all
representations of Boolean values except 1, which equates to the Boolean value of
true, to false.
Therefore Flash converts ColdFusion Boolean values of
"Yes", "True", and true to false.
To return a Boolean value correctly from ColdFusion to ActionScript, do either of the following:
• Return a 1 (true) or 0 (false) numeric or string value. For example, the following function
converts any ColdFusion Boolean value to a value that ActionScript can use correctly. (For
simplicity, this example omits error-handling code.) Your ColdFusion page can call this
function before returning a Boolean value to Flash Remoting:
<cffunction name="convertBool">
<cfif Arguments[1] >
<cfreturn "1">
<cfelse>
<cfreturn "0">
</cfif>
</cffunction>
• Specify the returnType="boolean" attribute in the cffunction tag, as in the following
example. When a Flash application calls this ColdFusion function as a service, the function
returns a valid Boolean value of
true to Flash.
<cffunction name="getBool" access="remote" returntype="boolean">
<cfset foo = True>
<cfreturn foo>
</cffunction>