
608
DEVELOPING
COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
Las
t
upda
te
d 8/5/2010
To use the Flash Remoting service with ColdFusion, you build ColdFusion pages and components or deploy Java
objects. In ColdFusion pages, you use the Flash variable scope to interact with SWF applications. ColdFusion
components (CFCs) natively support Flash interaction. The public methods of Java objects are also available to the
Flash Remoting service.
The Flash Remoting ActionScript API has been updated to comply with ActionScript 2.0. The ActionScript 2.0 version
of the API consists of the following significant features:
For more information on the ActionScript 2.0 Flash Remoting API, see Flash Remoting ActionScript Dictionary Help.
Configuring the Flash Remoting Gateway
The following parameters in the ColdFusion web.xml file point the Flash Remoting gateway to the gateway-config.xml
file.
<init-param>
<param-name>gateway.configuration.file</param-name>
<param-value>/WEB-INF/gateway-config.xml</param-value>
</init-param>
<init-param>
<param-name>whitelist.configuration.file</param-name>
<param-value>/WEB-INF/gateway-config.xml</param-value>
</init-param>
<init-param>
<param-name>whitelist.parent.node</param-name>
<param-value>gateway-config</param-value>
</init-param>
Both the web.xml file and the gateway-config.xml file are located in the WEB-INF directory of your ColdFusion server.
As a general rule, you do not have to change these web.xml settings.
Flash Remoting MX 2004 ActionScript 2.0 API Features
Enforcement of strict data typing, which requires you to declare the data types of variables and prohibits you from assigning different types
of data to them.
Enforcement of case sensitivity, which means that
myvar
and
myVar
are two different variables, though they were considered the same
variable with different spellings in ActionScript 1.0.
A new Service class, which lets you create a gateway connection and at the same time obtain a reference to a service and its methods. It
includes the
connection
property, which returns the connection and also lets you set credentials for authorization on the remote server.
Note: The NetServices class is still supported but has been deprecated in favor of the new Service and Connection classes
A new Connection class that helps you create and use Flash Remoting connections.
Note: The Connection class supersedes the former NetConnection class.
A new PendingCall object returned on each call to a service method that is run using the Service object. The PendingCall object contains the
responder property, which you use to specify the methods to handle the results of the service call.
A new RelayResponder class, which specifies the methods to which the result and fault outcomes of a service call are relayed.
A RecordSet object that contains new properties (
columnNames
,
items
, and
length
), new methods (
clear()
,
contains()
,
editField()
,
getEditingData()
,
getIterator()
,
getLocalLength()
,
getRemoteLength()
,
isEmpty()
, and
sortItems()
),
and the new
modelChanged
event.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...