About the Cf.query function and data sources
657
About the Cf.query function and data sources
You use the
CF.query
function to populate Macromedia Flash MX movie elements with data
retrieved from a Macromedia ColdFusion MX data source. To use the
CF.query
function you do
the following:
To pull data into your Flash MX movie from a ColdFusion MX data source:
1
Create a server-side ActionScript file that performs queries against a ColdFusion MX data
source.
2
Write ActionScript code in your Flash MX movie that references your ActionScript file (.asr)
on the ColdFusion server.
You create server-side ActionScript to execute the query and return the data in a record set to the
client—your Flash MX movie. You can use methods in the RecordSet ActionScript object on the
client to manipulate data in the record set and present data in your Flash MX movie.
Note:
Client-side ActionScript files use the .as extension. Server-side ActionScript files use the .asr
(
A
ction
S
cript
r
emote) extension.
Publishing dynamic data
You use the server-side ActionScript feature in ColdFusion MX to publish dynamic data. To do
this, you write server-side ActionScript files that perform queries against ColdFusion MX data
sources. Before using ActionScript, you must understand how to do the following:
•
Create database queries in the server-side ActionScript file using the
CF.query
ActionScript
function. See
“Using the CF.query function” on page 658
.
•
Reference the server-side ActionScript file in your Flash MX movie. See
“Connecting to the
Flash Remoting service” on page 654
.
Using the
CF.query
function, you can do the following tasks:
•
Create user login interfaces that validate users against a ColdFusion MX data source.
•
Populate form elements and data grids with data from a ColdFusion MX data source.
•
Create banners that pull data (such as URLs or image file paths) out of a database.
The
CF.query
function can retrieve data from any supported ColdFusion MX data source (see
“About ColdFusion MX data sources” on page 657
).
About ColdFusion MX data sources
For ColdFusion MX developers, the term
data source
can refer to a number of different types of
structured data accessible locally or across a network. You can query websites, Lightweight
Directory Access Protocol (LDAP) servers, POP mail servers, and documents in a variety of
formats. For server-side ActionScript, a data source ordinarily means the entry point to a
ColdFusion MX database.
Your ColdFusion MX administrator can help you identify and configure data sources. To create
ActionScript files that successfully perform queries on ColdFusion MX data sources, you must
know how the data source is identified by ColdFusion MX, as well as any other parameters that
affect your ability to connect to that database, such as whether a username and password are
required to connect.
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: ......