Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Ideally I would like it to go to the frame where I have it as there's quite a few layers within the end game frame. I don't know how I would code the end of the timer code.
Copy link to clipboard
Copied
Bonjour,
Tu peux importer ton clip vidéo depuis la bibliothèque addChild(my_video); elle se placera au dessus des autres calques.
Cordialement