Created
July 10, 2011 01:13
-
-
Save s9tpepper/1074123 to your computer and use it in GitHub Desktop.
Using the Cursor object getMore() 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
/* The getMore() method can be used to load more documents from the database | |
if getNextDocument() returns null.*/ | |
function onCursorReady(cursor:Cursor):void | |
{ | |
/*...do stuff...*/ | |
// Before calling getMore() make sure hasMore() returns true. | |
if (cursor.hasMore()) | |
{ | |
cursor.getMore().add(onGotMore); | |
} | |
} | |
/* The handler should expect the Cursor object. It will be the | |
same instance used to call getMore(). */ | |
function onGotMore(cursor:Cursor):void | |
{ | |
/* Retrieve documents either using toArray() or getNextDocument(). */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment