Flash remove movie clip

ok basicly i have a game which consists of many different games.

One main game which i am having trouble is the hangman game now basicly when the user clicks on the menu to play the hangman game the game loads up perectly and works perfectly however if the user wants to go back to the menu to play another game then the movie clips which loaded withing the handman game not disapear it is constently on the screen over lapping the menu and the other games to.

what i want to know is how i can use a button to go back to my main menu which is on frame one and also at the same time remove all these movies from the movie.

below is my code
thank you


[COLOR=#F000F0]*//Array containing all of the answers*[/COLOR] gameanswers = [COLOR=#000000][[/COLOR][COLOR=#0000FF]'Frosted Flakes'[/COLOR], [COLOR=#0000FF]'Cheerios'[/COLOR],                [COLOR=#0000FF]'Honey Combs'[/COLOR], [COLOR=#0000FF]'Lucky Charms'[/COLOR],                 [COLOR=#0000FF]'Honey Bunches of Oats'[/COLOR],                 [COLOR=#0000FF]'Apple Jacks'[/COLOR], [COLOR=#0000FF]'Rice Krispies'[/COLOR],                [COLOR=#0000FF]'Fruit Loops'[/COLOR], [COLOR=#0000FF]'Count Chocula'[/COLOR],                [COLOR=#0000FF]'Boo Berry'[/COLOR][COLOR=#000000]][/COLOR]; [COLOR=#F000F0]*//Attach the missgraphic*[/COLOR] [COLOR=#993300]this[/COLOR].[COLOR=#993300]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'missgraphic'[/COLOR],[COLOR=#0000FF]'missgraphic'[/COLOR],[COLOR=#993300]this[/COLOR].[COLOR=#993300]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR], [COLOR=#000000]{[/COLOR][COLOR=#993300]_x[/COLOR]:[COLOR=#000000]175[/COLOR],[COLOR=#993300]_y[/COLOR]:[COLOR=#000000]10[/COLOR][COLOR=#000000]}[/COLOR][COLOR=#000000])[/COLOR];   [COLOR=#F000F0]*//Function that begins a new game*[/COLOR] [COLOR=#993300]function[/COLOR] newGame[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#F000F0]*//select a random answer from the array*[/COLOR]     answer = gameanswers[COLOR=#000000][[/COLOR][COLOR=#993300]Math[/COLOR].[COLOR=#993300]floor[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]Math[/COLOR].[COLOR=#993300]random[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]*gameanswers.[COLOR=#993300]length[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]][/COLOR];     [COLOR=#F000F0]*//Add all 26 letter buttons to the stage*[/COLOR]     [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<[COLOR=#000000]26[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//Use the character code for each letter to attach the letter*[/COLOR]         [COLOR=#993300]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guessletter'[/COLOR], [COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR], [COLOR=#993300]this[/COLOR].[COLOR=#993300]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//set the x position according to its position in the alphabet*[/COLOR]         [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#993300]_x[/COLOR] = [COLOR=#000000]([/COLOR]curindex%[COLOR=#000000]13[/COLOR]-[COLOR=#000000]6[/COLOR].[COLOR=#000000]5[/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#000000]([/COLOR][COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#993300]_width[/COLOR]+[COLOR=#000000]3[/COLOR][COLOR=#000000])[/COLOR]+[COLOR=#993300]Stage[/COLOR].[COLOR=#993300]width[/COLOR]/[COLOR=#000000]2[/COLOR];         [COLOR=#F000F0]*//set the y position according to its position in the alphabet*[/COLOR]         [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#993300]_y[/COLOR] = [COLOR=#993300]Stage[/COLOR].[COLOR=#000000]height[/COLOR]-[COLOR=#000000]([/COLOR][COLOR=#000000]2[/COLOR]-[COLOR=#993300]Math[/COLOR].[COLOR=#993300]floor[/COLOR][COLOR=#000000]([/COLOR]curindex/[COLOR=#000000]13[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#000000]([/COLOR][COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#993300]_height[/COLOR]+[COLOR=#000000]3[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//set the character display to the current letter in the loop*[/COLOR]         [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] = [COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//When the player clicks the button, call the pressLetter function with the letter set*[/COLOR]         [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#993300]onPress[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//process the letter*[/COLOR]             pressLetter[COLOR=#000000]([/COLOR][COLOR=#993300]this[/COLOR].[COLOR=#000000]displayletter[/COLOR][COLOR=#000000])[/COLOR];             [COLOR=#F000F0]*//remove the button from the stage*[/COLOR]             [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#000000]}[/COLOR];     [COLOR=#000000]}[/COLOR]     [COLOR=#F000F0]*//Determine how many characters are going to be printed on each line.*[/COLOR]     [COLOR=#F000F0]*//Keep the letters of words from being split onto different lines *[/COLOR]     [COLOR=#F000F0]*//start the row count at 0*[/COLOR]     curline = [COLOR=#000000]0[/COLOR];     [COLOR=#F000F0]*//the start position in the answer is 0*[/COLOR]     linestart = [COLOR=#000000]0[/COLOR];     [COLOR=#F000F0]*//store the length of each line into an array*[/COLOR]     [COLOR=#993300]var[/COLOR] linelengths:[COLOR=#993300]Array[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Array[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#F000F0]*//traverse all of the characters in the answer*[/COLOR]     [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]linepos=[COLOR=#000000]0[/COLOR]; linepos<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; linepos++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//Maximum length of each formatted line*[/COLOR]         blanklinelength = [COLOR=#000000]25[/COLOR];         [COLOR=#F000F0]*//check if the linelength is smaller than the max line length or the first word on the line is longer than the max*[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]([/COLOR]linepos-linestart[COLOR=#000000])[/COLOR]<blanklinelength || linelengths[COLOR=#000000][[/COLOR]curline[COLOR=#000000]][/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//if the current character is a space, set a marker so we know how long the line should be*[/COLOR]             [COLOR=#F000F0]*//it may be updated if another word fits within the current line*[/COLOR]             [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]linepos[COLOR=#000000])[/COLOR] == [COLOR=#0000FF]' '[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#F000F0]*//update the length of the current line*[/COLOR]                 linelengths[COLOR=#000000][[/COLOR]curline[COLOR=#000000]][/COLOR] = linepos-linestart+[COLOR=#000000]1[/COLOR];             [COLOR=#000000]}[/COLOR]             [COLOR=#F000F0]*//else the line has reached its limit, so move to the next line and start at the end of the last word  *[/COLOR]         [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//store where to start the next line*[/COLOR]             linestart = linestart+linelengths[COLOR=#000000][[/COLOR]curline[COLOR=#000000]][/COLOR];             [COLOR=#F000F0]*//move to that position*[/COLOR]             linepos = linestart;             [COLOR=#F000F0]*//move to the next line*[/COLOR]             curline++;         [COLOR=#000000]}[/COLOR]     [COLOR=#000000]}[/COLOR]     [COLOR=#F000F0]*//set the length of the last line*[/COLOR]     linelengths[COLOR=#000000][[/COLOR]curline[COLOR=#000000]][/COLOR] = [COLOR=#993300]length[/COLOR][COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]-linestart;     [COLOR=#F000F0]*//Now we are going to add the blank holders to the stage*[/COLOR]     [COLOR=#F000F0]*//start at the first row*[/COLOR]     currow = [COLOR=#000000]0[/COLOR];     [COLOR=#F000F0]*//set the position to 0*[/COLOR]     curpos = [COLOR=#000000]0[/COLOR];     [COLOR=#F000F0]*//Loop through the answer and add the blank holders to the stage*[/COLOR]     [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//If the current position is a space, do not create a blank holder*[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR] != [COLOR=#0000FF]' '[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//add the letter holder*[/COLOR]             [COLOR=#993300]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'letterholder'[/COLOR], [COLOR=#0000FF]'holder'[/COLOR]+curindex, [COLOR=#993300]this[/COLOR].[COLOR=#993300]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];             [COLOR=#F000F0]*//set the x position relative to its position on the line and the number of characters on the line*[/COLOR]             [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#993300]_x[/COLOR] = [COLOR=#993300]Stage[/COLOR].[COLOR=#993300]width[/COLOR]/[COLOR=#000000]2[/COLOR]+[COLOR=#000000]([/COLOR][COLOR=#000000]([/COLOR]curpos-[COLOR=#000000]([/COLOR]linelengths[COLOR=#000000][[/COLOR]currow[COLOR=#000000]][/COLOR]/[COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#000000]20[/COLOR][COLOR=#000000])[/COLOR];             [COLOR=#F000F0]*//set the y position according to the currow*[/COLOR]             [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#993300]_y[/COLOR] = [COLOR=#000000]280[/COLOR]+[COLOR=#000000]([/COLOR]currow-[COLOR=#000000]([/COLOR]linelengths.[COLOR=#993300]length[/COLOR]/[COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR]*[COLOR=#000000]20[/COLOR];             [COLOR=#F000F0]*//if the current character is not A-Z, display it*[/COLOR]             [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]!hiddenCharacter[COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#F000F0]*//display the character, since it is a special character*[/COLOR]                 [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] = answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR];             [COLOR=#000000]}[/COLOR]         [COLOR=#000000]}[/COLOR]         [COLOR=#F000F0]*//If we are at the end of a row, go to the next row *[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]++curpos>=linelengths[COLOR=#000000][[/COLOR]currow[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//move to the next row*[/COLOR]             currow++;             [COLOR=#F000F0]*//reset the position to the left*[/COLOR]             curpos = [COLOR=#000000]0[/COLOR];         [COLOR=#000000]}[/COLOR]     [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR]  [COLOR=#F000F0]*//This function checks if the input character is an A-Z character*[/COLOR] [COLOR=#993300]function[/COLOR] hiddenCharacter[COLOR=#000000]([/COLOR]curchar[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#F000F0]*//Set of characters that aren't revealed*[/COLOR]     hiddenchars = [COLOR=#0000FF]'abcdefghijklmnopqrstuvwxyz'[/COLOR];     [COLOR=#F000F0]*//Loop through the character set*[/COLOR]     [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]charindex=[COLOR=#000000]0[/COLOR]; charindex<length[COLOR=#000000]([/COLOR]hiddenchars[COLOR=#000000])[/COLOR]; charindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//If the input character is in the list, hide it*[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]curchar.[COLOR=#993300]toLowerCase[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] == hiddenchars.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]charindex[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#993300]return[/COLOR] [COLOR=#993300]true[/COLOR];         [COLOR=#000000]}[/COLOR]     [COLOR=#000000]}[/COLOR]     [COLOR=#F000F0]*//character is not A-Z, so display it*[/COLOR]     [COLOR=#993300]return[/COLOR] [COLOR=#993300]false[/COLOR]; [COLOR=#000000]}[/COLOR]  [COLOR=#F000F0]*//function called each time a letter button is pressed*[/COLOR] [COLOR=#993300]function[/COLOR] pressLetter[COLOR=#000000]([/COLOR]pressedletter[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#F000F0]*//check if the pressed letter is in the answer*[/COLOR]     [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]!inAnswer[COLOR=#000000]([/COLOR]pressedletter[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//update the graphic to the next image*[/COLOR]         missgraphic.[COLOR=#993300]gotoAndStop[/COLOR][COLOR=#000000]([/COLOR]missgraphic.[COLOR=#993300]_currentframe[/COLOR]+[COLOR=#000000]1[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//check if the last frame has been reached*[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]missgraphic.[COLOR=#993300]_currentframe[/COLOR] == missgraphic.[COLOR=#993300]_totalframes[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//game lost. remove all of the remaining buttons*[/COLOR]             [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<[COLOR=#000000]26[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#F000F0]*//if the letter button exists, remove it*[/COLOR]                 [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                     [COLOR=#F000F0]*//delete the button. 65 is the ascii character A*[/COLOR]                     [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];                 [COLOR=#000000]}[/COLOR]             [COLOR=#000000]}[/COLOR]             [COLOR=#F000F0]*//the game has been lost, so fill in all of the blank spaces with the answers in red*[/COLOR]             [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#F000F0]*//if there is a space or the letter has been guessed already do nothing*[/COLOR]                 [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR] != [COLOR=#0000FF]' '[/COLOR] && [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                     [COLOR=#F000F0]*//the letter has not been guesed, so reveal it and make it red*[/COLOR]                     [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] = answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR];                     [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]letter[/COLOR].[COLOR=#993300]textColor[/COLOR] = [COLOR=#0000FF]'0xFF0000'[/COLOR];                 [COLOR=#000000]}[/COLOR]             [COLOR=#000000]}[/COLOR]             [COLOR=#F000F0]*//Display the button to start a new game*[/COLOR]             showPlayAgainButton[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#000000]}[/COLOR]     [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR]  [COLOR=#F000F0]*//This function checks to see if a guessed letter is in the answer*[/COLOR] [COLOR=#993300]function[/COLOR] inAnswer[COLOR=#000000]([/COLOR]pressedletter[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#F000F0]*//initialize goodletter to false. *[/COLOR]     [COLOR=#F000F0]*//we are going to loop through the answer to see if the guessed letter is in the answer*[/COLOR]     goodletter = [COLOR=#993300]false[/COLOR];     [COLOR=#F000F0]*//check if there are any letters in the answer that haven't been guessed yet*[/COLOR]     blankspace = [COLOR=#000000]0[/COLOR];     [COLOR=#F000F0]*//loop through the answer*[/COLOR]     [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//check if the guessed letter is the character in the current position of the answer *[/COLOR]         [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR].[COLOR=#993300]toLowerCase[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] == pressedletter.[COLOR=#993300]toLowerCase[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//display the character*[/COLOR]             [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] = answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR];             [COLOR=#F000F0]*//setting goodletter to true prevents the image from going to the next frame*[/COLOR]             goodletter = [COLOR=#993300]true[/COLOR];             [COLOR=#F000F0]*//if the character at the current position hasn't been guessed, reveal it*[/COLOR]         [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR] != [COLOR=#0000FF]' '[/COLOR] && [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]displayletter[/COLOR] == [COLOR=#993300]undefined[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//there is at least one letter that hasn't been guessed*[/COLOR]             blankspace = [COLOR=#000000]1[/COLOR];         [COLOR=#000000]}[/COLOR]     [COLOR=#000000]}[/COLOR]     [COLOR=#F000F0]*//if every letter has been guessed, the player wins*[/COLOR]     [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]!blankspace[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//remove all of the guess buttons*[/COLOR]         [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<[COLOR=#000000]26[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//if the button at the current position exists, remove it*[/COLOR]             [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guess'[/COLOR]+[COLOR=#993300]String[/COLOR].[COLOR=#993300]fromCharCode[/COLOR][COLOR=#000000]([/COLOR]curindex+[COLOR=#000000]65[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];             [COLOR=#000000]}[/COLOR]         [COLOR=#000000]}[/COLOR]         [COLOR=#F000F0]*//loop through all of the characters and set their color to green*[/COLOR]         [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//if the current character isn't a space, set its color to green*[/COLOR]             [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR] != [COLOR=#0000FF]' '[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#993300]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR].[COLOR=#000000]letter[/COLOR].[COLOR=#993300]textColor[/COLOR] = [COLOR=#0000FF]'0x00FF00'[/COLOR];             [COLOR=#000000]}[/COLOR]         [COLOR=#000000]}[/COLOR]         [COLOR=#F000F0]*//show the play again button*[/COLOR]         showwinButton[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#000000]}[/COLOR]     [COLOR=#F000F0]*//return whether or not the guessed letter exists in the answer *[/COLOR]     [COLOR=#993300]return[/COLOR] [COLOR=#000000]([/COLOR]goodletter[COLOR=#000000])[/COLOR]; [COLOR=#000000]}[/COLOR]  [COLOR=#F000F0]*//Show the button to play again*[/COLOR] [COLOR=#993300]function[/COLOR] showPlayAgainButton[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#F000F0]*//attach the button*[/COLOR]     [COLOR=#993300]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'playagain'[/COLOR], [COLOR=#0000FF]'playagain'[/COLOR], [COLOR=#993300]this[/COLOR].[COLOR=#993300]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#F000F0]*//move it to the middle of the screen*[/COLOR]     playagain.[COLOR=#993300]_x[/COLOR] = [COLOR=#993300]Stage[/COLOR].[COLOR=#993300]width[/COLOR]/[COLOR=#000000]2[/COLOR];     [COLOR=#F000F0]*//move it towards the bottom*[/COLOR]     playagain.[COLOR=#993300]_y[/COLOR] = [COLOR=#000000]370[/COLOR];     [COLOR=#F000F0]*//Add a listener for when the button is pressed. When pressed, start a new game*[/COLOR]     playagain.[COLOR=#993300]onPress[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]         [COLOR=#F000F0]*//Reset the hangman graphic to the first frame*[/COLOR]         missgraphic.[COLOR=#993300]gotoAndStop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]1[/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//loop through all of the letter holders of the answer on the screen and delete them*[/COLOR]         [COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]curindex=[COLOR=#000000]0[/COLOR]; curindex<length[COLOR=#000000]([/COLOR]answer[COLOR=#000000])[/COLOR]; curindex++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]             [COLOR=#F000F0]*//if the current position in the answer isn't a blank, remove it*[/COLOR]             [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]answer.[COLOR=#993300]charAt[/COLOR][COLOR=#000000]([/COLOR]curindex[COLOR=#000000])[/COLOR] != [COLOR=#0000FF]' '[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]                 [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'holder'[/COLOR]+curindex[COLOR=#000000])[/COLOR];             [COLOR=#000000]}[/COLOR]         [COLOR=#000000]}[/COLOR]         [COLOR=#F000F0]*//start a new game*[/COLOR]         newGame[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];         [COLOR=#F000F0]*//delete this button*[/COLOR]         [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'playagain'[/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#000000]}[/COLOR]; [COLOR=#000000]}[/COLOR]  [COLOR=#F000F0]*//Show the button to play again*[/COLOR] [COLOR=#993300]function[/COLOR] showwinButton[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]     [COLOR=#993300]gotoAndPlay[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'guessletter'[/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'letterholder'[/COLOR][COLOR=#000000])[/COLOR];     [COLOR=#993300]removeMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]'missgraphic'[/COLOR][COLOR=#000000])[/COLOR];      [COLOR=#000000]}[/COLOR] [COLOR=#F000F0]*//Start a new game when the applet loads*[/COLOR] newGame[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];