76
Chapter 4: Using Flash Remoting Data in ActionScript
For more information about each of these methods, see Flash Remoting ActionScript Dictionary
Help. The following sections describe how you can use these methods to create and manage
RecordSet objects in ActionScript code.
Using RecordSet methods and properties
The following sections describe how to use
RecordSet
methods to manage RecordSet objects.
Creating RecordSet objects
Most RecordSet objects are returned by service functions, so you do not typically have to create
them. However, you can use the RecordSet object constructor to create a record set directly in
ActionScript. For example, the following line creates a new RecordSet object with two columns:
DepartmentID and DepartmentName. This RecordSet object does not contain any data:
myRecordSet = new RecordSet(["DepartmentID", "DepartmentName"]);
Getting values and information from RecordSet objects
The following sections describe how to get record set values and information.
Getting record set data values
To get a specific record in the RecordSet object, specify the record’s 0-based index in the
getItemAt()
method. For example, the following line gets the third record in a record set:
myRecord = myRecordSet.getItemAt(2);
To get the value of a specific field in a record, use the column name as a property of the record.
For example, use the following line to get the value of the DepartmentName field of the fourth
record in the RecordSet object named myRecordSet:
myDept = myRecordSet.getItemAt(3).DepartmentName;
Note:
Because the RecordSet object implements all of the ActionScript DataProvider methods, you
can also use RecordSet objects directly with any object that takes a DataProvider, such as the Flash
UI ComboBox Component. For more information on using RecordSet objects with Flash UI
components, see
“Using Flash UI components with RecordSet objects” on page 83
.
RecordSet.setDeliveryMode()
Changes the delivery mode of a pageable record set from an
application server.
RecordSet.setField()
Replaces one field of a record with a new value.
RecordSet.sort()
Sorts all the records using a comparison function that you
specify as an argument to the method.
RecordSet.sortItems()
Sorts all the records using a user-specified comparison
function
RecordSet.sortItemsBy()
Sorts all records in the RecordSet object in ascending or
descending order, according to the current locale’s sorting
order.
Method
Description
Содержание FLASH REMOTING MX
Страница 1: ...Using Flash Remoting for Flash MX 2004 ActionScript 2 0...
Страница 8: ...8 Contents...
Страница 62: ...62 Chapter 3 Using the RemotingConnector component Flash Professional only...
Страница 142: ...142 Chapter 7 Using Flash Remoting for Java...