|But as Max was leaving||אבל כשמקס עמד לצאת|
We don't have an adequate parallel for "as" in the sense of "while". In this case we used כאשר – "when" (כש – short for כאשר).
For "while" we have בזמן ש.
|While (in the time that) you were sleeping I finished all the work.||בזמן שישנת אני גמרתי את כל העבודה.|