All are correct, but I would caution the use of 'while' on the last sentence. It's not incorrect but it's probably not the best word to use here. I think it's because 'while' signifys two events happening at the same time but doesn't include the implication that one event is a consequence of the other, whereas 'as' and 'when' can have this implication.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.