# Timer for SS and global

**URL:** <https://forum.kirupa.com/t/timer-for-ss-and-global/244370>\
**Category:** flash\
**Created:** [November 16, 2007, 9:17pm UTC](https://forum.kirupa.com/t/timer-for-ss-and-global/244370 "2007-11-16T21:17:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Multi\_Task](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Multi\_Task](https://forum.kirupa.com/u/Multi_Task)\
**Post date:** [November 16, 2007, 9:17pm UTC](https://forum.kirupa.com/t/timer-for-ss-and-global/244370/1 "2007-11-16T21:17:10Z")

</div>

question about global vars

I am trying to set a timer when no activity removeMovie and attach screen saver. I am trying to use a global var so that I can reset the count. Here is my AS what can I do to reset my timer.

```auto

_global.ss = 3;
countDown = function (loadScreen) {
ss --;
if (ss == 0) {
clearInterval(timer);
cont.removeMovieClip("startMC");
cont.attachMovie("screenSaver", "saver", 0);
}
}
timer = setInterval (countDown, 1000);

```

Then within screenSaver I have a function like so:

```auto

onMouseMove = function () {
_root.cont.removeMoveClip.....
_root.cont.attachMovie.....
_global.ss = 3;

```

how can i reset ss so that it will do countdown again?
