RecordSet.setField( )

RecordSet.setField( ) MethodFlash 6

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



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


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


The value that you are setting the field to.


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( ).


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

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

See Also

RecordSet.replaceItemAt( )

    Part III: Advanced Flash Remoting