# How do I return to the Menu?

**URL:** <https://forum.kirupa.com/t/how-do-i-return-to-the-menu/322710>\
**Category:** flash\
**Created:** [May 31, 2011, 1:27pm UTC](https://forum.kirupa.com/t/how-do-i-return-to-the-menu/322710 "2011-05-31T13:27:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![meetspin](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@meetspin](https://forum.kirupa.com/u/meetspin)\
**Post date:** [May 31, 2011, 1:27pm UTC](https://forum.kirupa.com/t/how-do-i-return-to-the-menu/322710/1 "2011-05-31T13:27:29Z")

</div>

Hey guys,

I’ve been a long time lurker and decided to finally sign up because I would really appreciate your help with something I’ve been scratching my head with for a few days now.  
Please download the attachments if you would care to help…

If you have done so, you’ll see there is a MoveEnemy.as, SpawnEnemy.as and StartGame.as and SpawnEnemy.fla

MoveEnemy.as = a way for me to add an enemy  
SpawnEnemy.as = the menu  
StartGame.as = the game in action

Apologies for the terrible names.

I’m having an issue at the moment where I don’t know how to return to the main menu after clicking the “Menu” button while the game is running.  
So the example/scenario is:

1. The SWF opens and SpawnEnemy.as (which is the Main Menu) is executed. A Start Button appears.

2. I click the Start button which executes StartGame.as and a ball repeatedly loops along the y axis. So far so good.

**3. I click on the Menu button…how do I get back to the SpawnEnemy.as or how do I get back to the menu that contains my Start button?**

I already have:  
var startGame:StartGame = new StartGame();  
in SpawnEnemy.as (my Menu)

and when I insert:  
var spawnEnemy:SpawnEnemy = new SpawnEnemy();  
in StartGame.as, it crashes (hence why it’s commented out)

Does anyone have a solution?
