This is the 5072nd most frequent Korean word.
나가며
"나가며" means "while going out" or "as one goes out."
Here, '나가며' conveys performing an action concurrently with exiting or leaving a place.
나가며 뒷문도 확인해주세요.
As you exit, please check the back door too.
Here, '나갔다' is used to express departing a location or exiting, indicating the action of moving out from the house.
나는 문을 닫으며 집을 나갔다.
I closed the door and went out of the house.
In this context, '나가며' represents the action of exiting or heading towards a general area, specifically downtown, during which something occurred.