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
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
with ActionScript typed objects" on page
•
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
Therefore Flash converts ColdFusion Boolean values of
To return a Boolean value correctly from ColdFusion to ActionScript, do either of the following:
•
Return a 1 (
true
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"
example. When a Flash application calls this ColdFusion function as a service, the function
returns a valid Boolean value of
<cffunction name="getBool" access="remote" returntype="boolean">
<cfset foo = True>
<cfreturn foo>
</cffunction>
method to assign an object type to a flashgateway.io.ASObject object
setType()
) or 0 (
) numeric or string value. For example, the following function
false
true
71.
"Yes"
attribute in the
cffunction
to Flash.
ColdFusion to ActionScript data conversion issues
true
,
, and
to
"True"
true
tag, as in the following
"Working
, to
.
false
.
false
69
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?