On they flew through the gathering darkness; Harry's face felt stiff and cold, his legs numb from gripping the Thestral's sides so tightly, but he did not dare shift his position lest he slip ... he was deaf from the thundering rush of air in his ears, and his mouth was dry and frozen from the cold night wind.
Harry Potter and the Order of the Phoenix
I don't quite understand the use of 'ON' in the clause above. Is it an adverb or prep.? I feel it's saying while on the way they flew through the gathering darkness. Is my understanding correct?