Skip navigation
Currently Being Moderated

How do I make a main menu for a game?

Nov 22, 2012 10:48 AM

Hi,

I need to make a main menu for this tower defense game that I am making.  I have 2 parts to the menu that I need to put together.  I have it as follows:

 

I have a start screen where the player presses the start button.  I now need it to take the user to the main menu itself.  I have both the start menu and main menu in the same document but on different layers.  I have a button labeled as start which I have set up to where when it is clicked, it changes colors but I also need it to hide/show the menu layer.  I just need the that start button to take users to the menu layer where I have 3 more buttons which are resume, new, and options.  I will need those buttons to go to their different layers also.  After users hit the resume or new buttons, I need the game itself to start which I will start making after I figure out the other issues. 

 

I am new to Flash and I really want to learn how to make tower defense games.  For now, I am using http://www.ehow.com/how_7788131_make-tower-defense-game-flash.html as a guide to make the game stuff but it doesn't say anything about a main menu.  I am using a trial version of Flash Pro CS6 and it is due to expire in 28 days.

 

Any and all help will be great! Thanks, xp3tp85

 
Replies
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 22, 2012 11:19 AM   in reply to xp3tp85

    convert your menu to a movieclip (select it, right click, click convert to symbol, movieclip). assign an instance name in the properties panel (eg, main_menu);

     

    assign your start button an instance name in the properties panel (eg, start_button).

     

    you can then use:

     

    main_menu.visible = false;

    start_button.addEventListener(MouseEvent.CLICK,startF);

    function startF(e:MouseEvent):void{

    main_menu.visible = true

    }

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 22, 2012 12:25 PM   in reply to xp3tp85

    add:

     

    stop()

     

    to that first frame that has your start button.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 22, 2012 9:36 PM   in reply to xp3tp85

    you're welcome.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 23, 2012 7:12 AM   in reply to xp3tp85

    click file>publishing settings>swf and tick "permit debugging".  retest.

     

    the problematic line of code will be in the error message.  that will allow you to quickly find the object that does not exist when that line of code executes.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 24, 2012 6:42 AM   in reply to xp3tp85

    there is never any reason to declare the same variable or function more than once on one timeline and you should expect to trigger a compiler error if you try.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 24, 2013 10:22 PM   in reply to xp3tp85

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points