Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

End Message at the end of countdown timer

New Here ,
Dec 05, 2019 Dec 05, 2019

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. 

TOPICS
ActionScript , Code , How to
603
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2019 Dec 05, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 05, 2019 Dec 05, 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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2019 Dec 05, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 05, 2019 Dec 05, 2019

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 08, 2019 Dec 08, 2019
LATEST

Bonjour,

Tu peux importer ton clip vidéo depuis la bibliothèque addChild(my_video); elle se placera au dessus des autres calques.

Cordialement 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines