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

84 Chapter 4: Using Flash Remoting Data in ActionScript
By default, each label value is a comma-delimited string that consists of the contents of one
record’s fields; the data values are not set. However, you can use a RecordSet object directly in the
dataProvider property to provide both the list and data values if the record set has two columns
and the column names are label and data. For example, the following SQL code produces a record
set that, when passed to the preceding
getProductList_Result() function, populates the
catalogListBox object with both label and data values:
SELECT COST_CENTER AS DATA, DESCRIPTION AS LABEL
FROM EMPDB_DEPARTMENT
WHERE STATUS='Active'
Using DataGlue methods
The DataGlue class methods,
bindFormatStrings and bindFormatFunction, let you specify
how a RecordSet object supplies the contents of both the data and value fields of a data consumer.
The DataGlue class methods provide substantial flexibility in formatting the contents of the labels
and data, as follows:
• The bindFormatStrings() method lets you independently specify strings that contain any
number of record set fields and other data as the sources of the label and data contents.
• The bindFormatFunction() method lets you specify any function to provide the data to the
data consumer. The function must take a record as an argument and returns an object that
consists of two entries: a label field and a data field. The function has full flexibility in using
the record contents to generate and format the label and data values.
The DataGlue class methods do not make a copy of the DataProvider object. However, the data is
fetched from the data provider as needed by the component.
Using the bindFormatStrings method
The bindFormatStrings() method lets you freely format record fields and string data. For
example, the following method uses values from two fields to generate the labels and from three
fields to generate the data values:
DataGlue.bindFormatStrings (myComboBox, myRecordSet, "#parkname#
(#parktype#)", "#city#, #state# #zipcode#");
In this example, myComboBox represents a ComboBox component in the Flash application, and
myRecordSet represents the RecordSet object. The parkname, parktype, city, state, and zip code
variables represent record field names. The Flash application displays the parkname and parktype
variables in the ComboBox. The city, state, and zipcode variables are returned when the user
selects the record and ActionScript code uses a
getValue, getSelectedItem, or similar, method.
Using the bindFormatFunction() method
The bindFormatFunction() method lets you call a function to format the data for your data
consumer. Your function must take a record as its argument and return an object with the
following format:
{label: labelValue, data: dataValue};