# \*\*\* Count Down Timer \*\*\*

**URL:** <https://forum.kirupa.com/t/count-down-timer/29498>\
**Category:** flash\
**Created:** [August 27, 2003, 2:50pm UTC](https://forum.kirupa.com/t/count-down-timer/29498 "2003-08-27T14:50:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)\
**Post date:** [August 27, 2003, 2:50pm UTC](https://forum.kirupa.com/t/count-down-timer/29498/1 "2003-08-27T14:50:55Z")

</div>

Why won’t this work…

I want to create a dynamic text box.  
set a (start) and (stop) time.  
have the time change along with each frame.

its a blank movie with 150 frames.

this is in frame 1.

[AS]  
count\_start = 150;  
count\_stop = 0;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
var output = new TextFormat();  
output.font = “Arial”;  
output.size = 16;  
output.align = “center”;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
this.createTextField(“count”,0,100 ,100,100,20);  
count.setNewTextFormat(output);  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
if (count\_start \> count\_stop){  
count.text = count\_start;  
count\_start = count\_start -1;  
nextFrame();  
}  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2003, 3:03pm UTC](https://forum.kirupa.com/t/count-down-timer/29498/2 "2003-08-27T15:03:14Z")

</div>

Jumped for the help to soon…

all it needed was

\_root.onEnterFrame = function() {

[AS]  
count\_start = 150;  
count\_stop = 0;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
var output = new TextFormat();  
output.font = “Arial”;  
output.size = 16;  
output.align = “center”;  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
this.createTextField(“count”,0,100 ,100,100,20);  
count.setNewTextFormat(output);  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\_root.onEnterFrame = function() {  
if (count\_start \>= count\_stop){  
count.text = count\_start;  
count\_start = count\_start -1;  
nextFrame();  
}  
}

[/AS]
