# Reseting timeline to first frame if no event detected for a interval of time using AS 2.0

**URL:** <https://forum.kirupa.com/t/reseting-timeline-to-first-frame-if-no-event-detected-for-a-interval-of-time-using-as-2-0/634199>\
**Category:** flash\
**Created:** [January 29, 2016, 9:38am UTC](https://forum.kirupa.com/t/reseting-timeline-to-first-frame-if-no-event-detected-for-a-interval-of-time-using-as-2-0/634199 "2016-01-29T09:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![everybodysmokes](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/everybodysmokes/32/7377_2.png) [@everybodysmokes](https://forum.kirupa.com/u/everybodysmokes)\
**Post date:** [January 29, 2016, 9:38am UTC](https://forum.kirupa.com/t/reseting-timeline-to-first-frame-if-no-event-detected-for-a-interval-of-time-using-as-2-0/634199/1 "2016-01-29T09:38:50Z")

</div>

Hi! all.  
i had searched a lot regarding this topic but no help.  
All i want is that if their is no interaction being made by the user in the flash file for a period on one minute than the timeline should move to the first frame of swf.  
Plzzz help urgently require this

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [January 29, 2016, 9:41am UTC](https://forum.kirupa.com/t/reseting-timeline-to-first-frame-if-no-event-detected-for-a-interval-of-time-using-as-2-0/634199/2 "2016-01-29T09:41:49Z")

</div>

This is basically the sort of code you’d want:

```javascript
var now = new Date
onMouseMove = function(){
    now = new Date
}

setInterval(function(){
    var newNow = new Date
    if(newNow - now >= 60 * 1000) gotoAndPlay(1)
}, 1000)

```
