660
Chapter 30: Using Server-Side ActionScript
These functions are available for every RecordSet object returned by the
CF.query
function to the
Flash MX client. You invoke these functions as follows:
objectName.functionName();
For example, in the result function that you create to handle record set data returned by the
CF.query
function, you can reference the database column names returned in the record set using
the
getColumnNames
RecordSet function:
function selectData_Result ( result )
{
//result holds the query data; employeesView is a Flash list box
stringOutput.text = result.getColumnNames();
_root.employeesView.setDataProvider(result);
}
Building a simple application
The following procedure describes how to build a simple server-side ActionScript application.
The example application, a corporate personnel directory, uses the NetServices object to connect
to the
personneldirectory
server-side ActionScript. The
personneldirectory
server-side
ActionScript retrieves data from a ColdFusion MX data source and returns the results to the Flash
movie as a RecordSet object.
Note:
The server-side ActionScript application that you create provides the back-end services in an
application.
This example requires the following:
•
A server-side ActionScript file named personneldirectory.asr that includes functions that
interact with a ColdFusion MX data source.
•
A client-side Flash MX movie in which the NetServices object is created.
To create the application:
1
Write server-side ActionScript that performs the database query and returns data to the client
through the Flash Remoting service.
2
Create the Flash movie interface. See
“Creating the Flash movie interface” on page 661
.
3
Define a search function that sends user data to the Flash Remoting service. See
“Submitting
user data to the Flash Remoting service” on page 662
.
4
Define a result function that captures the results returned from the Flash Remoting service. See
“” on page 662
.
5
Ensure that the Flash movie has established a connection to the Flash Remoting service. See
“Checking for a Flash Remoting service connection” on page 663
.
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......