ColdFusion Datatype Conversion

ActionScript 1.0 and CFML are both loosely typed languages. There is a close correlation between ActionScript datatypes and ColdFusion datatypes, but there are a few notable differences. Table A-1 shows the conversion from Flash ActionScript to ColdFusion.

Table A-1. Flash-to-ColdFusion datatype conversion

Flash (ActionScript)

ColdFusion (CFML)

ActionScript object

Struct (or ASObject)

ActionScript object (as only argument)

Named arguments

Array (indexed)

Array

Associative Array

Struct

Boolean

Boolean

Date Object

Date

Number

Number

RecordSet

-

String

String

Undefined

Null

XML Object

XML document

Null

Null

Table A-2 shows the conversion from ColdFusion to Flash ActionScript.

Table A-2. ColdFusion-to-Flash datatype conversion

ColdFusion (CFML)

Flash (ActionScript)

Struct

Associative array

Java object (flashgateway.IO.ASObject)

ActionScript object

Java object (flashgateway.IO.ASObject with type property set)

ActionScript object of that type

Array

Array (indexed)

Struct

Array (associative)

Boolean

String [1]

Date

Date object

Number

Number

Query object

RecordSet

String

String

XML document

XML object

Null

Null

[1] Booleans should be passed as numbers (1 or 0) from ColdFusion to Flash. A 1 will be passed as “true” to Flash, and anything else will pass as “false”. For that reason, ColdFusion Booleans are not accurately returned to Flash.

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.