Created
July 10, 2011 01:01
-
-
Save s9tpepper/1074111 to your computer and use it in GitHub Desktop.
Using the Cursor object getNextDocument() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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