# Exit(?) a class

**URL:** https://forum.kirupa.com/t/exit-a-class/234339
**Category:** flash
**Created:** [August 1, 2007, 2:03pm UTC](https://forum.kirupa.com/t/exit-a-class/234339 "2007-08-01T14:03:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mmorosky](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@mmorosky](https://forum.kirupa.com/u/mmorosky)
#### Post date: [August 1, 2007, 2:03pm UTC](https://forum.kirupa.com/t/exit-a-class/234339/1 "2007-08-01T14:03:47Z")

</div>

I’ve created a short game where the main class file, MainGame, creates an instance of the actual game, ActualGame. MainGame displays the start screen complete with a “Play game” button which creates an instance of ActualGame. After playing this game, I want the user to be able to end the game and go back to the MainGame screen. I am not sure how to somehow flag to the main class that I am done with the actual game.

I thought about including a loop in MainGame that checks a Boolean variable isPlaying that can be changed to false when the player wants to go back to the main menu… There has to be a better way though… Anyone?
