MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Use Manual page 104

Using flash remoting for flash mx 2004 actionscript 2.0
Table of Contents

Advertisement

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
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
function cfQuery_Result (re:ResultEvent):Void
{
DataGlue.bindFormatStrings(employeeData, re.result, "#ItemName#,
#ItemDescription#, #ItemCost#");
}
In this example,
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. 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
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:
Create a ColdFusion page, and save it as getData.cfm in the helloExamples directory.
1.
Modify getData.cfm as follows:
2.
<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.
Save the file.
3.
104
Chapter 6: Using Flash Remoting with ColdFusion MX
cfQuery()
is a Flash list box. This result handler displays the columns
employeeData
Flash.Pagesize
variable sets the number of records in each page.
function, you access the record set as follows:
variable to return five records at a time to
Flash.Result

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 and is the answer not in the manual?

This manual is also suitable for:

Flash remoting mx

Table of Contents