User Guide
Table Of Contents
- Contents
- About Flash Remoting
- Getting Started
- Using Flash Remoting ActionScript
- Using the RemotingConnector component (Flash Professional only)
- Using Flash Remoting Data in ActionScript
- About Flash Remoting and data types
- Understanding Action Message Format
- Converting from ActionScript to application server data types
- Converting from application server data types to ActionScript
- ColdFusion to ActionScript data conversion issues
- About working with objects
- About working with RecordSet objects
- About working with XML
- The NetConnection Debugger
- Using Flash Remoting with ColdFusion MX
- Using Flash Remoting for Java
- About Flash Remoting for Java
- Calling Java classes or JavaBeans from ActionScript
- Calling Enterprise JavaBeans (EJBs) from Flash
- Calling servlets and JSPs from Flash
- Calling JMX MBeans from Flash (JRun only)
- Calling server-side ActionScript from Flash (JRun only)
- Handling function results in ActionScript
- Using Flash Remoting with JRun security
- Passing XML objects between Flash and Java
- Viewing Flash Remoting log entries
- Using Flash Remoting for Microsoft .NET
- Flash Remoting for Microsoft .NET
- Calling ASP.NET pages from Flash
- Making an ASP.NET page available to Flash Remoting
- Getting a reference to an ASPX-based service in ActionScript
- Invoking ASPX pages in ActionScript
- Using the Flash Remoting custom server control in ASPX pages
- Using the Flash Remoting namespace in code-behind files
- Using ASP.NET state management with Flash Remoting
- Using ASP.NET exception handling
- Using ADO.NET objects with Flash Remoting
- Displaying a RecordSet object in Flash with ActionScript
- Calling web services from Flash
- Calling ASP.NET assemblies from Flash
- Viewing Flash Remoting log entries
- Using NetServices and Connection Classes
- Index

104 Chapter 6: Using Flash Remoting with ColdFusion MX
Depending on the SQL code of the query and the amount of data stored in the database, the
query can return a single record, a few records, or a very large number of records. To pass the
entire record set to the Flash application, you simply write the record set to the
Flash.Result
variable.
In ActionScript, you access the record set columns to display the query. For example, you use the
following ActionScript code to call a ColdFusion page named cfQuery.cfm that contains the
previous query:
myService.cfQuery("RipperStik");
In the result handler for the cfQuery() function, you access the record set as follows:
function cfQuery_Result (re:ResultEvent):Void
{
DataGlue.bindFormatStrings(employeeData, re.result, "#ItemName#,
#ItemDescription#, #ItemCost#");
}
In this example, employeeData is a Flash list box. This result handler displays the columns
ItemName, ItemDescription, and ItemCost from each record in the result set, separated by
commas, in the list box.
Returning record sets in increments
ColdFusion lets you return record set results to Flash in increments. For example, if a query
returns 20 records, you can set the
Flash.Pagesize variable to return five records at a time to
Flash. Incremental record sets let you minimize the time that the Flash application waits for the
application server data to load.
The entire record set is called a pageable record set and each increment is called a page. Therefore,
the
Flash.Pagesize variable sets the number of records in each page.
The ColdFusion page executes once and returns all the results to the Flash Remoting gateway.
The Flash application then requests subsequent records from the gateway as required.
To create a ColdFusion page that returns an incremental record set to Flash:
1.
Create a ColdFusion page, and save it as getData.cfm in the helloExamples directory.
2.
Modify getData.cfm as follows:
<cfset Flash.Pagesize = Flash.Params[1]>
<cfquery name="myQuery" datasource="ExampleApps">
SELECT ItemName, ItemDescription, ItemCost
FROM tblItems
</cfquery>
<cfset Flash.Result = myQuery>
In this example, you pass a parameter from the Flash application that defines the increment
size.
3.
Save the file.