Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 10, 2011 01:13
Show Gist options
  • Save s9tpepper/1074123 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074123 to your computer and use it in GitHub Desktop.
Using the Cursor object getMore() method
/* 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