RecordSet.removeItemAt( )

RecordSet.removeItemAt( ) MethodFlash 6

removes a record from a recordset
myRecordSet.removeItemAt(index)

Arguments

index

The index number of the record to be deleted.

Description

The removeItemAt( ) method deletes a row in a RecordSet object. The internal identifier of the row is removed and not used again, and the length of the RecordSet object is reduced by one.

Example

The following code adds two records to the recordset, then deletes the first record (the record in the 0 position):

#include "RecordSet.as"
var myRecordset_rs = new RecordSet(["First", "Last", "Email"]);
myRecordset_rs.addItem({First:"Tom", Last:"Muck", Email:"tom@tom-muck.com"});
myRecordset_rs.addItem({First:"Jack", Last:"Splat", Email:"jack@tom-muck.com"});
myRecordset_rs.removeItemAt(0);
trace(myRecordset_rs.getLength( ));

In this case, the Output window displays "1" because one row has been deleted.

See Also

RecordSet.addItemAt( ), RecordSet.getItem`At( ), RecordSet.getLength( ), RecordSet.getRemoveAll( ), RecordSet.replaceItemAt( )



    Part III: Advanced Flash Remoting