Using results returned by the CF.query function
You use functions in the RecordSet ActionScript object to access the data returned in a
record set; for example, how many records are in the record set and the names of the columns.
You can also use the RecordSet functions to pull the query data out of the record set. To do so,
you reference a specific row number in the record set and use the
as in the following example:
// This function populates a Flash text box with data in the first row
// of the record set under the "email" column name.
function selectData_Result ( result )
{
stringOutput.text = result.getItemAt(0)["email"];
_root.employeesView.setDataProvider(result);
}
In the example, the column name is referenced in the
brackets [ ]. (In ActionScript, indexes start at 0, so
For more information, see
Using results returned by the CF.http function
The
server-side ActionScript function returns data as simple text. You write server-side
CF.http
functions that reference the properties available in the object returned by the
These properties store the file content of the retrieved file, HTTP status codes, the MIME type of
the returned file, and so on. On the client side, you create return functions to handle data
returned by the
CF.http
For more information, see
Global and request scope objects
Global and request scope objects are implicitly available in all server-side ActionScript. The
following table describes these scope objects:
Scope name Type
config
Global
application
Global
request
Request An object containing client request information. The object provides data,
response
Request An object to assist in sending a response to the client. It provides HTTP-
For more information about these scope objects, see the documentation on the javax.servlet class
at http://java.sun.com.
656
Chapter 30: Using Server-Side ActionScript
"Using the CF.query function" on page
function. You write these functions to handle simple text data.
"Using the CF.http function" on page
Description
Initialization information for the server-side ActionScript adapter.
Class:
javax.servlet.ServletConfig
The context for the current web application. The context defines methods
that provide, for example, the MIME type of a file that can be used to write
to a log file. There is one context per web application.
Class:
javax.servlet.ServletContext
including parameter name and values, attributes, and an input stream.
Class:
HttpServletRequest
specific functionality in sending a response. Do not use the OutputStream
or PrintWriter to send data back to the client.
Class:
HttpServletResponse
javax.servlet.ServletResponse
getItemAt
function between square
getItemAt
returns the first row.)
getItemAt(0)
658.
664.
(subtype of
javax.servlet.ServletRequest
(subtype of
)
CF.query
RecordSet function,
function.
CF.http
)
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?