User Guide

322 Chapter 6: Components Dictionary
Example
This example searches for the first item in the current collection whose name and age fields
contain
"Bobby" and "13". If found, DataSet.getItemId() is used to get the unique identifier
for the item in the collection, and
DataSet.locateById() is used to position the current iterator
on that item.
var studentID:String = null;
studentData.addSort("nameAndAge", ["name", "age"]);
// Locate the first transfer object with the specified values.
// Note that the order of the search fields matches those
// specified in addSort().
if(studentData.findFirst(["Bobby", "13"])) {
studentID = studentData.getItemId();
}
// Now use locateByID() to position the current iterator
// on the item in the collection whose ID matches studentID.
if(studentID != null) {
studentData.locateById(studentID);
}
See also
DataSet.applyUpdates()
, DataSet.getItemId(), DataSet.locateById()
DataSet.findLast()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.findLast(searchValues)
Parameters
searchValues
An array that contains one or more field values to be found within the
current sort.
Returns
Returns true if the items are found; otherwise, returns false.
Description
Method; searches the current view of the collection for the last item with the field values specified
by
searchValues. Which items are in the current view depends on any current filter and
range settings.
The values specified by
searchValues must be in the same order as the field list specified by the
current sort (see the example below).