# getTimer and Sound problem

**URL:** <https://forum.kirupa.com/t/gettimer-and-sound-problem/76278>\
**Category:** flash\
**Created:** [January 16, 2005, 9:53pm UTC](https://forum.kirupa.com/t/gettimer-and-sound-problem/76278 "2005-01-16T21:53:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossarian](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@yossarian](https://forum.kirupa.com/u/yossarian)\
**Post date:** [January 16, 2005, 9:53pm UTC](https://forum.kirupa.com/t/gettimer-and-sound-problem/76278/1 "2005-01-16T21:53:07Z")

</div>

I’m about to tear my hair out over this one 🅰, so please help!

I want a timer function to be tied to the sound, so that when the sound stops the movie goes to a new frame depending on:

```
 a) if they fail before end of sound it takes them to a **You Lose** frame
 b) if they succeed... **You Got it** frame
 
 this is the code I'm using on frame 2 where the sound is stored:

```

```auto
displayTime = 30; 
     	  countDown = function(message){
       
     		  displayTime--; 
     		  if (displayTime == 0){
       
     			  clearInterval(timer); 
     			  trace("Times Up!");
       
     		  }
       
     	  } 
     	  timer = setInterval(countDown, 1000);  

```

```
 Nice little AS, but I don't need the trace function, I'd like users to know! 
 
 Hope this makes sense!

I'd really appreciate a nudge in the right direction :bounce:
 
 Y
```
