Contents > Developing ColdFusion MX Applications > Using Server-Side ActionScript > Using server-side ActionScript functions > Using the function results in ActionScript Using results returned by the CF.query function PreviousNext

Using results returned by the CF.query function

You use functions in the RecordSet ActionScript object to access the data returned in a CF.query 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 getItemAt RecordSet function, 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 getItemAt function between square brackets [ ]. (In ActionScript, indexes start at 0, so getItemAt(0) returns the first row.)

For more information, see Using the CF.query function.


Contents > Developing ColdFusion MX Applications > Using Server-Side ActionScript > Using server-side ActionScript functions > Using the function results in ActionScript Using results returned by the CF.query function PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.