# Simple Score/Timer Error

**URL:** <https://forum.kirupa.com/t/simple-score-timer-error/318529>\
**Category:** flash\
**Created:** [January 23, 2011, 1:19am UTC](https://forum.kirupa.com/t/simple-score-timer-error/318529 "2011-01-23T01:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pattyx01](https://avatars.discourse-cdn.com/v4/letter/p/c6cbf5/32.png) [@pattyx01](https://forum.kirupa.com/u/pattyx01)\
**Post date:** [January 23, 2011, 1:19am UTC](https://forum.kirupa.com/t/simple-score-timer-error/318529/1 "2011-01-23T01:19:27Z")

</div>

I’ve used flash for websites, but never for games. I’m an illustrator not a developer so I know my script is messed up somewhere. The simple concept of the game is to blow out all the candles on the cake. The timer works and so does the score, but when the score hits 10 i want it to go to and play “happyBirthday”. When the time runs out it does go to “playAgain”, but when round two comes up, the blownout candles are not lit again… so for some reason, its not resetting and the timer begins at 0 and decreases (-1,-2,-3 etc.). What am I doing wrong?

here is the script:

function gameScoreAdd()  
{  
gameScore = gameScore + 1;  
if (gameScore == 10)  
{  
clearInterval(timer);  
stopAllSounds ();  
gotoAndPlay (“happyBirthday”);  
} // end if  
} // End of the function  
function countDown()  
{  
–gameTime;  
if (gameTime == 0)  
{  
clearInterval(timer);  
stopAllSounds ();  
gotoAndPlay(“playAgain”);  
} // end if  
} // End of the function  
function resetGame()  
{  
gameScore = 0;  
gameTime = gameTimeMaster;  
} // End of the function  
gameTimeMaster = 15;  
resetGame();

Here are the varibles:

var my\_sound = new Sound();  
my\_sound.attachSound();  
my\_sound.start(0, 1000000);  
timer = setInterval(countDown, 1000);  
var score:Number = 10;//declare score variable

Appreciate any comments/suggestions!
