# Implementing Different Program States

**URL:** <https://forum.kirupa.com/t/implementing-different-program-states/236831>\
**Category:** flash\
**Created:** [August 24, 2007, 12:04am UTC](https://forum.kirupa.com/t/implementing-different-program-states/236831 "2007-08-24T00:04:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![endemoniada](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@endemoniada](https://forum.kirupa.com/u/endemoniada)\
**Post date:** [August 24, 2007, 12:04am UTC](https://forum.kirupa.com/t/implementing-different-program-states/236831/1 "2007-08-24T00:04:44Z")

</div>

Hi guys,

I made a simple solitaire game; I set my document in CS3 to Main.as and did everything in there. Now I want to add to it by doing something like this:

startup: show loading screen while the image files load, then…  
menu: game menu with a start button that goes to…  
game: the game itself (what I made so far) with a quit button that goes back to the menu

I really have no idea how to do that. The states would have to have access to each other; for example, I’d have to be able to access the graphics loaded during ‘startup’ from the ‘menu’ and ‘game’. I’d like to have an .as class/file for each state so I can re-use them in other games, if possible.

Any help getting me started would be appreciated, tutorial links would be better.

Thank you.
