Ping Pong - Sound Menu
| Category | : Flash | Views | : 35836 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : ping-pong-sound-menu.zip | ||
| Result | : See the result | ||||
| <<< Previous | Index Series |
Our menu is going to be a simple frame with the game's name and a button.

First drag the frame we already have to the second frame.

Needs to change to this:

Now on that empty frame we are going to make our menu.
Write "Pong" and "Play", then select the Play text box and press F8 to convert it to a symbol.
Convert to a button and give any name you want.
If you want you can make the animations for each frame in the button.
Go back to the main timeline and in each frame add this in the first line of actions:
stop();
This will prevent flash from going to the second frame before the user presses "Play".Give the Play button the instance name of "PlayBtn", go to the actions for the menu frame and add the code for the button:
//you should already have added this code
stop();
//when the button is pressed and then released
PlayBtn.onRelease = function()
{
//go to frame 2 and then stop
_root.gotoAndStop(2);
}
Now go to the scrolling Movie Clip we did on the previous tutorial, add a new layer that should not be below the mask:

In that layer create a new text "Menu" and convert it to a new Button with the instance name "MenuBtn":

In the actions for that layer, paste this:
//when the button is released
MenuBtn.onRelease = function()
{
//go to the menu frame in the main timeline
_root.gotoAndStop(1);
//remove the Scroll Movie Clip
_root.Scroll.removeMovieClip();
}
The menu is done so let's put the sound in.Download a sound file from the source code of this tutorial or if you have any other you like then go to 'File > Import > Import to Library' and select you sound.
When it is on the library right click, select linkage and set the identifier to "Pong".
More cool tech articles from other blogs.
| <<< Previous | Index Series |
