# How do i reset/add time to my delay?

**URL:** <https://forum.kirupa.com/t/how-do-i-reset-add-time-to-my-delay/222618>\
**Category:** flash\
**Created:** [April 15, 2007, 1:05pm UTC](https://forum.kirupa.com/t/how-do-i-reset-add-time-to-my-delay/222618 "2007-04-15T13:05:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fr\_ode](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr\_ode](https://forum.kirupa.com/u/fr_ode)\
**Post date:** [April 15, 2007, 1:05pm UTC](https://forum.kirupa.com/t/how-do-i-reset-add-time-to-my-delay/222618/1 "2007-04-15T13:05:36Z")

</div>

The code show’s the movieclip “nav” when “bg\_inv” is clicked, and fades it out when 5 seconds have passed. What I want to achieve is this:

When I click a button inside “nav” called “next\_btn” the delay needs to be reset, so that “nav” doesn’t fade out until five seconds have passed since I clicked the button.

Any help would be apreciated. :m2:

```auto
nav._visible = false;
import mx.transitions.Tween;
import mx.transitions.easing.*;

MovieClip.prototype.myProto = function ()
{
    name=this._name;
    nav._alpha = 100;
    nav._x = Math.round(_xmouse-(nav._width/2));
    nav._y = Math.round(_ymouse-(nav._height/2));
    nav._visible = true;

    fncContinue = function () {
        var fadeNav:Tween = new Tween(nav, "_alpha", Strong.easeOut, 100, 0, 0.7, true);
        fadeNav.onMotionFinished = function() {
            nav._visible = false;
            bg_inv.onMouseDown = function() {
                bg_inv.myProto();
                delete this.onMouseDown;
            };
        };
        clearInterval(itvDelay);
    };
    itvDelay = setInterval(fncContinue, 5000);
}

bg_inv.onMouseDown = function() {
    bg_inv.myProto();
    delete this.onMouseDown;
};

```
