3 Replies - 1358 Views - Last Post: 11 May 2010 - 06:32 AM

#1 reyco1  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 43
  • Joined: 20-March 05

Countdown Timer

Posted 31 December 2006 - 01:47 PM

Description: make a dynamic text feild and give it a variable name of: displayTime. Place the code on the first frame of the movie.good for Games! or whatever :D Written by senocular (senocular.com). Original can be found at http://www.kirupa.co...etinterval2.htm
// Author: senocular.com
// http://www.kirupa.com/developer/actionscript/setinterval2.htm

displayTime = 10;
countDown = function () {
     displayTime--;
     if (displayTime == 0) {
          clearInterval(timer);
     }
};
timer = setInterval(countDown, 1000);


Is This A Good Question/Topic? 0
  • +

Replies To: Countdown Timer

#2 hoho501  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 12-November 08

Re: Countdown Timer

Posted 12 January 2009 - 07:00 AM

how can you make it so when you click a button it starts to count down and then not start again after you click it a second time
Was This Post Helpful? 0
  • +
  • -

#3 salientknight  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 05-March 09

Re: Countdown Timer

Posted 05 March 2009 - 06:14 AM

This code is close, but you forgot that you have to address a dynamic textbox using .text.. to get this code to work try this: tm=10; displayTime.text = tm; countDown = function () { tm--; displayTime.text=tm; if (tm==0) { clearInterval(timer); } }; timer = setInterval(countDown, 1000);
Was This Post Helpful? 0
  • +
  • -

#4 dhiraj141  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 11-May 10

Re: Countdown Timer

Posted 11 May 2010 - 06:32 AM


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1