Would the boldfaced be a preposition or adverb? And why?

As they flew over, we thought we could hear their wild cries.