Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 10, 2011 01:01
Show Gist options
  • Save s9tpepper/1074111 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074111 to your computer and use it in GitHub Desktop.
Using the Cursor object getNextDocument() method
/* Once the Cursor is returned to the callback the Cursor's
getNextDocument() method can be used to handle each of
the documents returned */
function onCursorReady(cursor:Cursor):void
{
// Get the first document
var doc:Object = cursor.getNextDocument();
// If there was a first document, do something and get next.
while (doc)
{
// Do something, such as add it to a data provider
myDP.addItem(doc);
// Try to get another document, returns null when there are no more.
doc = cursor.getNextDocument();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment