Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 621

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
Using Flash with CFCs
CFCs require little modification to work with a SWF application. The tag
contains the CFML logic, the
application. The name of the CFC file (*.cfc) translates to the service name in ActionScript.
Note: For CFC methods to communicate with SWF applications, set the
The following example replicates the
For more information, see
"Using the Flash Remoting service with ColdFusion
Create a CFC that interacts with a SWF application
Create a CFC and save it as flashComponent.cfc in the helloExamples directory.
1
2
Modify the code in flashComponent.cfc so that it appears as follows:
<cfcomponent name="flashComponent">
<cffunction name="helloWorld" access="remote" returnType="Struct">
<cfset tempStruct = StructNew()>
<cfset tempStruct.timeVar = DateFormat(Now ())>
<cfset tempStruct.helloMessage = "Hello World">
<cfreturn tempStruct>
</cffunction>
</cfcomponent>
In this example, the
helloWorld
Save the file.
3
The
service function is now available through the
helloWorld
following ActionScript example calls this function:
tag names the arguments, and the cfreturn tag returns the result to the SWF
cfargument
function that was previously implemented as a ColdFusion page.
helloWorld
function is created. The
Last updated 1/20/2012
tag names the method and
cffunction
tag's
cffunction
access
pages" on page 611.
tag returns the result to the SWF application.
cfreturn
service to ActionScript. The
flashComponent
616
attribute to
.
remote

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents