How to make 'game over' appear when timer hits 0 AS3
So I am new to using Animate and AS3 and I can't find how to make 'game over' appear on the screen when the timer runs out. I am making an escape game and I have made a timer that countdowns from 90 seconds but when it gets to 0 I want it to say game over. Instead it does nothing.
Here is the Actionscript I have used for my timer:
//Timer
var nCount:Number = 90;
var myTimer:Timer = new Timer(1000, nCount);
timer_txt.text = nCount.toString();
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER, countdown);
function countdown(e:TimerEvent):void
{
nCount--;
timer_txt.text = nCount.toString();
}
But what do I need to add in order to make 'game over' pop up when the timer hits 0? I have also created the game over screen on the second frame on the timeline.
Thanks!
