# AS3 Game Menus- What's Good Practice?

**URL:** <https://forum.kirupa.com/t/as3-game-menus-whats-good-practice/327415>\
**Category:** flash\
**Created:** [February 28, 2012, 12:12am UTC](https://forum.kirupa.com/t/as3-game-menus-whats-good-practice/327415 "2012-02-28T00:12:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgm432](https://avatars.discourse-cdn.com/v4/letter/l/7cd45c/32.png) [@lgm432](https://forum.kirupa.com/u/lgm432)\
**Post date:** [February 28, 2012, 12:12am UTC](https://forum.kirupa.com/t/as3-game-menus-whats-good-practice/327415/1 "2012-02-28T00:12:41Z")

</div>

So I am once again doing stuff with flash and actionscript, and finally attempting to make a game. As per general good code convention, I wish to have no code or items on the timeline. Chances are I’ll use a finite-state machine to switch between game states, but my question is about menus; namely, how should I go about making them and switching in/out of the game screen when the game changes state? Should I add all the menu elements to an array and iterate through them, adding and removing them as children to the stage? Or is there a better, more accepted method for making aforementioned menus? My google results turned up very little information on how to actually make the state switch, so how do you all do it?
