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:
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;
};