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

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

Advertisement

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
property to provide both the list and data values if the record set has two columns
dataProvider
and the column names are label and data. For example, the following SQL code produces a record
set that, when passed to the preceding
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,
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()
number of record set fields and other data as the sources of the label and data contents.
The
bindFormatFunction()
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()
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
Using the bindFormatFunction() method
The
bindFormatFunction()
consumer. Your function must take a record as its argument and return an object with the
following format:
{label: labelValue, data: dataValue};
84
Chapter 4: Using Flash Remoting Data in ActionScript
getProductList_Result()
bindFormatStrings
method lets you independently specify strings that contain any
method lets you specify any function to provide the data to the
method lets you freely format record fields and string data. For
getValue
method lets you call a function to format the data for your data
function, populates the
and
bindFormatFunction
,
getSelectedItem
, let you specify
, or similar, method.

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?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash remoting mx

Table of Contents