You are mixing up Arrays and Collections.
Almost all sets of DOM objects are returned as collections and not Arrays. (Some exceptions are allPageItems -- or anything else that starts with all or textConainers.) Document.pages is a collection. To iterate through the collection you should use myCollection.item(index). To convert a collection to an Array (which you might want to do for performance reasons), you use myCollection.everyItem().getElements().
app.activeDocument.pages is the same as writing
app.activeDocument.pages.item(0), but that does not work in Actionscript.