setTimeout/clearTimeout faulty code?

Hello,

I’m using AS2 and Flash 8. I originally used the first code below to return to the start site if a user had left the page idle for 10 seconds.

Problem was, even if a user had hit the “next” button to activate the next movieClip, the timer function hadn’t been deactivated and STILL took the user back to the start site 10 seconds into the next movie.

This is my original code without a mouseListener:

stop();

function backTostart()
{
_parent.gotoAndStop(1)
}

setTimeout(backTostart,10000)


So I tried adding a mouseListener to activate a clearTimer if the mouse was clicked, but it didn’t work. I’m new at this, so maybe I’m missing an obvious syntax error. Could someone please have a look? Thank you!

var Timer:Number = setTimeout(backTostart, 10000);

function backTostart () {
_parent.gotoAndStop(1);
}

var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
if (onMouseDown == true) {
clearTimeout(Timer);
}
};

Mouse.addListener(mouseListener);

This is driving me crazy. If anyone has a suggestion, that’d be great!