User Guide
DataSet component (Flash Professional only) 317
DataSet.disableEvents()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.disableEvents()
Returns
Nothing.
Description
Method; disables events for the DataSet object. While events are disabled, no user interface
controls (such as a DataGrid component) are updated when changes are made to items in the
collection, or when the DataSet object is scrolled to another item in the collection.
To reenable events, you must call
DataSet.enableEvents(). The disableEvents() method
can be called multiple times, and
enableEvents() must be called an equal number of times to
reenable the dispatching of events.
Example
In this example, events are disabled before changes are made to items in the collection, so the
DataSet object won’t try to refresh controls and impact performance.
// Disable events for the data set
myDataSet.disableEvents();
myDataSet.last();
while(myDataSet.hasPrevious()) {
var price = myDataSet.price;
price = price * 0.5; // Everything's 50% off!
myDataSet.price = price;
myDataSet.previous();
}
// Tell the data set it's time to update the controls now
myDataSet.enableEvents();
See also
DataSet.enableEvents()
DataSet.enableEvents()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.