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

About working with RecordSet objects 79
To set up a notification event for an ActionScript object, use the RecordSet
addEventListener() method and specify the object to notify when the RecordSet object
changes. You can specify any object that receives change notifications in the
addEventListener() method, as in the following example:
myRecordSet.addEventListener("modelChanged", contact_grid);
In this example, the myRecordSet object represents a record set returned from Flash Remoting,
and the
addEventListener() method tells Flash Remoting to notify the contact_grid object
whenever the theRecordSet object changes.
The object that receives the notification must include a
modelChanged callback function to
handle the notification. Whenever the RecordSet object changes, the
modelChanged function
gets called with a message object that consists of one or more entries, as follows:
• The first entry, eventName, identifies the type of event or change that was made to the record.
• For some types of events, the message object also includes entries identifying the first and last
record in the record set that were affected by the event.
The types of events that can occur and be specified in the
eventName property are addItems,
allRows, fetchRows, sort, removeItem, removeItems, and updateItems. Depending on the
value of
eventName, the following properties might provide additional information: firstItem,
lastItem, removedIDs, and removedItems. For descriptions of RecordSet events and properties,
see the RecordSet class in Flash Remoting ActionScript Dictionary Help.
The following example creates a
modelChanged function that displays a trace message with the
event type and sets it up as the callback handler for changes to the myRecordSet object:
var myObj = new Object();
myObj.modelchanged = function(info)
{
trace("Caught modelChanged event: " + info.eventName);
}
myRecordSet = new RecordSet(["DepartmentID", "DepartmentName"]);
myRecordSet.addEventListener("modelChanged", myObj);
The following example of activity on the myRecordSet RecordSet causes the modelChanged
function to display
addItems as the event name:
var newDept = {DepartmentID: "6504", DepartmentName: "Customer Relations"};
myRecordSet.addItemAt(15, newDept);
For more information on the RecordSet.addEventListener() and
RecordSet.removeEventListener() methods, see the RecordSet.addEventListener() and the
RecordSetRemoveEventListener in Flash Remoting ActionScript Dictionary Help.
Sorting and filtering record sets
The
RecordSet class has methods for sorting an existing RecordSet object or creating a new
RecordSet object from an existing one by applying a selection (filter) function.