User Guide

Table Of Contents
Using Flash Remoting with ColdFusion pages 101
The following table lists ActionScript collections and describes how to access them in ColdFusion
pages:
Accessing ActionScript objects
ActionScript supports the object initializer syntax when calling a function. For example, the
following function call passes two parameters as objects:
myService.myMethod({x:1, y:2});
In this example, the function passes x with a value of 1 and y with a value of 2.
In your ColdFusion page, you can access objects using the object name, as in the following
example:
<cfset param1=Flash.x>
<cfset param2=Flash.y>
You can also pass arrays and structures using this syntax, as follows:
var array1:Array = new Array();
array1[0] = "zero";
array1[1] = "one";
var struct1:Array = new Array();
struct1["zero"] = "banana";
struct1["one"] = "orange";
myService.myMethod({x:array1, y:struct1});
Collection ActionScript example Notes
Strict array
var myArray:Array = new Array();
myArray[0] = "zero";
myArray[1] = "one";
myService.myMethod(myArray)
;
The Flash Remoting service converts
the array parameters to a ColdFusion
MX array. All CFML array operations
work as expected.
<cfset p1=Flash.Params[1][1]>
<cfset p2=Flash.Params[1][2]>
Named or
associative array
var myStruct:Array = new Array();
myStruct["zero"] = "banana";
myStruct["one"] = "orange";
myService.myMethod(myStruct)
;
In ActionScript, named array keys are
not case sensitive.
<cfset p1=Flash.Params[1].zero>
<cfset p2=Flash.Params[1].one>
Named
parameters using
object initializer
myService.myMethod({x:1, y:2,
z:3});
Provides a convenient way of passing
named parameters to ColdFusion
pages. Access these parameters in
ColdFusion pages as members of the
Flash scope.
<cfset p1=Flash.x>
<cfset p2=Flash.y>
<cfset p3=Flash.z
>