User Guide

Table Of Contents
Using Flash Remoting with ColdFusion components 109
</cffunction ...>
</cfcomponent>
You can also pass arrays, structures, and named objects using this syntax. The following
ActionScript code defines an object:
var params:Object = new Object();
params.first = "Hello";
params.second = true;
service.concat(params);
In a component, you access the object elements using named parameters, as follows:
<cfcomponent>
<cffunction name="concat" access="remote" returntype="any">
<cfargument name="first" type="any" required="true">
<cfargument name="second" type="any" required="true">
<cfreturn first & second>
</cffunction>
</cfcomponent>
This component specifies that two parameters are required. An ActionScript object satisfies this
requirement, because it is split into named arguments. However, an ActionScript array does not.
Passing objects from ActionScript lets you use the Arguments scope within a component
function. The Arguments scope works the same way as the Flash scope in ColdFusion pages. In a
component, you can access parameters using the syntax
Arguments.paramName. Therefore, you
can access the params object from the previous example as follows:
<cfcomponent>
<cffunction name="concat" access="remote" returntype="any">
<cfset p1=Arguments.first>
<cfset p2=Arguments.second>
</cffunction>
</cfcomponent>
Using component metadata with the Flash Remoting service
Flash designers can use the Service Browser in the Flash authoring environment to discover
business logic functionality built into ColdFusion. You use the
description attribute of the
cffunction and cfargument tags to describe the ColdFusion functionality to the Service
Browser.