Skip to main content
Participant
December 5, 2019
Question

End Message at the end of countdown timer

  • December 5, 2019
  • 1 reply
  • 649 views

Hi!

I'm making a game on animate for uni. I was wondering within HTML 5 canvas after my timer finishes the 90 seconds, show an end game frame that I have made already. 

 

var secondsLeft = 90;

this.countdown_txteasy.text = secondsLeft;

var timerId = setInterval(countdown.bind(this), 1000);

function countdown(){

if(secondsLeft == 0){

}

else{

secondsLeft--;

this.countdown_txteasy.text = secondsLeft;

}

}

 

That is what I have for my timer and would want a message after the 90 seconds. 

This topic has been closed for replies.

1 reply

Legend
December 5, 2019

I don't know what it means to "overall" something, but if you just want to display some text in a textfield, you clearly already know how to do that. So what's the problem?

Gonza46Author
Participant
December 5, 2019

My bad, I just realised how that didn't make sense.

I have an end game screen that is a layer in my timeline. I would like that layer to be shown after the 90 seconds has finished. I'm quite new to animate so discovering everything as I go. 

Legend
December 5, 2019

Make the layer a movieclip. Give it an instance name. Set its .visible state to hide or show it.

 

Also, clear your timer when time runs out or it will keep counting down.