As the owls flooded into the Great Hall as usual, everyone's attention was caught at once by a long, thin package carried by six large screech owls.
A thousand live bats fluttered from the walls and ceiling while a thousand more swooped over the tables in low black clouds, making the candles in the pumpkins stutter. (Harry Potter book1)
In the examples, what’s the difference between ‘as’ and ‘while’? Can each be changed with each other?