User Guide

DataSet component (Flash Professional only) 341
Returns
A Boolean value indicating whether the item was removed.
Description
Method; removes the item at the specified index. The indices after the removed index collapse
by one.
This method triggers the
modelChanged event with the event name removeItems.
In addition, it triggers the DataSet.removeItem event, which contains the
result and item
properties. The
result property is used to determine if the item (referenced by the item property
of the event) can be removed. By default, the
result property is set to true, or if no event
listener is specified for the
removeItem event, the item will be removed by default.
An event listener can stop the item from being removed by listening for the
removeItem event
and setting the
result property of the event to false, as shown in this example:
function removeItem(eventObj:Object):Void {
// don’t allow anyone to remove the item with customerId == 0
eventObj.result = eventObj.item.customerId != 0;
}
Example
This example removes an item from the data set at the fourth position:
myDataSet.removeItemAt(3);
DataSet.removeRange()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.removeRange()
Returns
Nothing.
Description
Method; removes the current end point settings specified by DataSet.setRange() for the
current iterator.
Example
myDataSet.addSort("name_id", ["name", "id"]);
myDataSet.setRange(["Bobby", 105],["Cathy", 110]);
while(myDataSet.hasNext()) {
myDataSet.gradeLevel ="5"; // change all of the grades in this range
myDataSet.next();