RecordSet.setField( )

RecordSet.setField( ) MethodFlash 6

sets a field within a record
myRecordSet.setField(index, fieldName, value)

Arguments

index

The index number of the recordset row that contains the field to be replaced.

fieldName

The field name of the field that you want to replace the contents of.

value

The value that you are setting the field to.

Description

The setField( ) method replaces the contents of a single field within a row, with no effect on the other fields, allowing for finer control over updating than replaceItemAt( ).

Example

The following code creates a recordset and then replaces the email address in the first record:

#include "RecordSet.as"
var myRecordset_rs = new RecordSet(["First", "Last", "Email"]);
myRecordset_rs.addItem({First:"Tom", Last:"Muck", Email:"tom@tom-muck.com"});
var email = 'jacksplat@tom-muck.com';
myRecordset_rs.setField(0,"Email", email);
trace (myRecordset_rs.getItemAt(0).Email;

See Also

RecordSet.replaceItemAt( )



    Part III: Advanced Flash Remoting