Timing movie clips

Hello,
Ok I am making a menu that opens up on mouse rollover and I cant really figure out how to make the script to close it after a few seconds if they havent moved the mouse inside of it… I know that last sentence might not make alot of sense but Im basically just trying to make the menu move back to its original spot if the mouse hasnt rolled over it in 5 seconds. Can anyone point me in the right direction?
thanks

so no one knows what Im talking about?

try something like this

function getoldX() {
oldX = _xmouse;
clearInterval(Int1);
}
function checkMouse() {
if (Math.abs(_xmouse-oldX<5) && Math.abs(_ymouse-oldY<5)) {
trace(“close”);
clearInterval(myInterval);
} else {
oldX = _xmouse;
oldY = _ymouse;
}
}
mc.onRollOver = function() {
trace(“open”);
myInterval = setInterval(checkMouse, 5000);
Int1 = setInterval(getoldX, 100);
};
mc.onRollOut = function() {
clearInterval(myInterval);
};

won`t give you exactly 5seconds but should be ok for what you want

thanks for the response but the code you provided has a problem… I inserted the code and changed it to match my movie clip name but Im getting a type mismatch error

Error Scene=Scene 8, layer=actions, frame=47:Line 7: Type mismatch.
if (Math.abs(_xmouse-oldX<5) && Math.abs(_ymouse-oldY<5)) {
Total ActionScript Errors: 1 Reported Errors: 1

any ideas?

sorry, try this
function getoldX() {
oldX = _xmouse;
clearInterval(Int1);
}
function checkMouse() {
if (Math.abs(_xmouse-oldX)<5 && Math.abs(_ymouse-oldY)<5) {
trace(“close”);
clearInterval(myInterval);
} else {
oldX = _xmouse;
oldY = _ymouse;
}
}
mc.onRollOver = function() {
trace(“open”);
myInterval = setInterval(checkMouse, 5000);
Int1 = setInterval(getoldX, 100);
};
mc.onRollOut = function() {
clearInterval(myInterval);
};

lol
ok no errors now but whenever I rollover my mc it just pops up open on the output box while Im live previewing it… hmm… Im trying to work on it but Im not familiar with a couple of the commands so I dont know if Im going to be able to figure this one out on my own.

all you have to do is replace the traces with a call to the function(s) which open/close your menu.

function getoldX() {
oldX = _xmouse;
clearInterval(Int1);
}
function checkMouse() {
if (Math.abs(_xmouse-oldX)<5 && Math.abs(_ymouse-oldY)<5) {
_root.nav.gotoAndPlay(“down”);
clearInterval(myInterval);
} else {
oldX = _xmouse;
oldY = _ymouse;
}
}
nav.onRollOver = function() {
_root.nav.gotoAndPlay(“up”);
myInterval = setInterval(checkMouse, 5000);
Int1 = setInterval(getoldX, 100);
};
nav.onRollOut = function() {
clearInterval(myInterval);
};

well for some reason its still not working so hears what Im putting in. I just cant seem to figure it out… now nothing happens

if you upload your fla, i`ll see if i can sort it out for you

cool Id really appriciate it man

http://www.zerosignaldesigns.com/fla.zip

can you upload a version without my code which is working . I`m unclear how you are going to use your rollOvers/rollOuts with nav.