Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 10, 2011 01:07
Show Gist options
  • Save s9tpepper/1074117 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074117 to your computer and use it in GitHub Desktop.
Using the Cursor object toArray() method
/* Alternatively, once the Cursor is returned to the callback the Cursor's
toArray() method can be used to retrieve an Array of all the documents that
the Cursor object has loaded. */
function onCursorReady(cursor:Cursor):void
{
// Get array of all documents
var documents:Array = cursor.toArray();
// Do something, such as add it to a data provider
myDP = new ArrayCollection(documents);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment