I believe that you have invoked a preview via the SPACEBAR. Such a preview will stop when AE is no longer the active application. Such a preview also does not include audio.
Instead, you should invoke a RAM Preview, which is done by hitting the ZERO key on the numeric keypad.
HTH
– Roland
Intensive mocha & AE Training in Singapore and Other Dangerous Locations
Adobe After Effects CC ACE/ACI
Imagineer Systems (mocha) Certified Instructor