User Guide

Table Of Contents
830 Chapter 34: Using Server-Side ActionScript
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 831.
Reference the server-side ActionScript file in your Flash MX movie. See “Connecting to the
Flash Remoting service” on page 826.
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 MXdata 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 830).
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.
You use server-side ActionScript in ColdFusion MX to return record set data to a Flash MX client
from a ColdFusion MX data source. You specify the ColdFusion MX data source name and the
SQL statement you execute on the data source as arguments in the
CF.query function in server-
side ActionScript.
Typically, your server-side ActionScript handles the interaction with the ColdFusion MX data
source, and returns a record set to the Flash MX client through the Flash Remoting service.
For more detailed information about ColdFusion MX data sources, see Configuring and
Administering ColdFusion MX.