Code Snippets

  

ActionScript Source Code


Welcome to Dream.In.Code
Become an Expert!

Join 137,189 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,328 people online right now. Registration is fast and FREE... Join Now!





Countdown Timer

good for Games! or whatever :D Written by senocular (senocular.com). Original can be found at http://www.kirupa.com/developer/actionscript/setinterval2.htm

Submitted By: reyco1
Actions:
Rating:
Views: 49,845

Language: ActionScript

Last Modified: December 31, 2006
Instructions: make a dynamic text feild and give it a variable name of: displayTime. Place the code on the first frame of the movie.

Snippet


  1. // Author: senocular.com
  2. // http://www.kirupa.com/developer/actionscript/setinterval2.htm
  3.  
  4. displayTime = 10;
  5. countDown = function () {
  6.      displayTime--;
  7.      if (displayTime == 0) {
  8.           clearInterval(timer);
  9.      }
  10. };
  11. timer = setInterval(countDown, 1000);

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month