# Stop this timer when it hits zero? How?

**URL:** <https://forum.kirupa.com/t/stop-this-timer-when-it-hits-zero-how/331387>\
**Category:** Uncategorized\
**Created:** [July 22, 2013, 1:29pm UTC](https://forum.kirupa.com/t/stop-this-timer-when-it-hits-zero-how/331387 "2013-07-22T13:29:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![themoon](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@themoon](https://forum.kirupa.com/u/themoon)\
**Post date:** [July 22, 2013, 1:29pm UTC](https://forum.kirupa.com/t/stop-this-timer-when-it-hits-zero-how/331387/1 "2013-07-22T13:29:17Z")

</div>

I tried asking this on a different flash forum but I didn’t get anywhere with them. So… does anyone know how to make this timer stop at 0? It counts down to zero but when it reaches it, it starts adding to it then. So instead of it being 00 days, 00 hours, 00 mins… it will begin adding to it.

How do I make it stop and stay at 00 when the count down reaches this target?

Bonus: Is there a way to make it blink or flash when it DOES reach 00?

```auto
[COLOR=#007700][FONT=monospace]var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]targetDate[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Date [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= new [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Date[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]2013[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]07[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]15[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]24[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// Date = Year, Month (minus 1), Day, HourSet)
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]addEventListener[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Event[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]ENTER_FRAME[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]loop[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);

function [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]loop[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]e[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Event[/FONT][/COLOR][COLOR=#007700][FONT=monospace]):[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]void
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]{
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]nowDate[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Date [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= new [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Date[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]ms[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Number [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]targetDate[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]getTime[/FONT][/COLOR][COLOR=#007700][FONT=monospace]() - [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]nowDate[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]getTime[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Number [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Math[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]floor[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]ms[/FONT][/COLOR][COLOR=#007700][FONT=monospace]/[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1000[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Number [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Math[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]floor[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec[/FONT][/COLOR][COLOR=#007700][FONT=monospace]/[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]60[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Number [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Math[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]floor[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace]/[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]60[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
    var [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]day[/FONT][/COLOR][COLOR=#007700][FONT=monospace]:[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Number [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]Math[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]floor[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]/[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]24[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);

    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec [/FONT][/COLOR][COLOR=#007700][FONT=monospace]% [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]60[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min [/FONT][/COLOR][COLOR=#007700][FONT=monospace]% [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]60[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr [/FONT][/COLOR][COLOR=#007700][FONT=monospace]% [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]24[/FONT][/COLOR][COLOR=#007700][FONT=monospace];

    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]daystxt[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]text [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]day[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hrstxt[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]text [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= ([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr [/FONT][/COLOR][COLOR=#007700][FONT=monospace]< [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]10[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) ? [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"0" [/FONT][/COLOR][COLOR=#007700][FONT=monospace]+ [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]():[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]hr[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]minstxt[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]text [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= ([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min [/FONT][/COLOR][COLOR=#007700][FONT=monospace]< [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]10[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) ? [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"0" [/FONT][/COLOR][COLOR=#007700][FONT=monospace]+ [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]():[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]min[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]secstxt[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]text [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= ([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec [/FONT][/COLOR][COLOR=#007700][FONT=monospace]< [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]10[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) ? [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"0" [/FONT][/COLOR][COLOR=#007700][FONT=monospace]+ [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]():[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]sec[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]toString[/FONT][/COLOR][COLOR=#007700][FONT=monospace]();[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]
    [/FONT][/COLOR][COLOR=#007700][FONT=monospace]}
} [/FONT][/COLOR]

```

All this does btw is point to a dynamic text box that has 00 00 00. (Days, hours, mins)
