Using Arrays for an event handler

Yeah! Something like that. I don’t want it to pause/play again when you go back to the viewport, but yes I do want it to stop. How do I achieve that with an array?