User Guide
Data translation 23
The session ID is the client ID assigned to your Flex application. Reloading the Flex
application starts a new session with a new session ID.
To set credentials in a message in Flex, before sending the message through the gateway to the
CFC, you use the
setRemoteCredentials method, as follows:
var msg:Message = new AsyncMessage();
msg.body = input.text;
msg.headers.gatewayID = "Flex2CF";
msg.setRemoteCredentials("mycfusername", "mycfpassword");
To authenticate the credentials sent in the message, in an Application.cfm or Application.cfc
file, you use the
cflogin tag, as follows:
<cfapplication name="authenticateuser" sessionmanagement="yes">
<cflogin>
<cfif isDefined("cflogin.name") or isDefined("cflogin.password")>
<cfloginuser name="#cflogin.name#" password="#cflogin.password#"
roles="#roles#">
</cfif>
</cflogin>
Data translation
The following table lists the ColdFusion data types and the corresponding Adobe Flash or
ActionScript data type:
ColdFusion data type Flash data type
String String
Array [] = Array
Struct {} = untyped Object
Query Array of untyped Objects
CFC Class = typed Object (if a matching ActionScript class
exists, otherwise the CFC becomes a generic untyped
Object (map) in ActionScript)
CFC Date ActionScript Date
CFC String ActionScript String
CFC Numeric ActionScript Numeric
ColdFusion XML Object ActionScript XML Object