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

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

Advertisement

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

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash remoting mx

Table of Contents