Multiple Key Press Help

I’m working on a simple game where the object is to hit as many keys as possible in a given time and then be given a score.

I have used the following code:

keyListener = new Object(
    keyListener.onKeyDown = function() {
        numlol++;
    };
    Key.addListener(keyListener);
}

However, when the time runs out and you’re taken to the screen where your score is displayed, the actionscript continues running and you still gain points by hitting the keys.

I’ve tried using a boolean, but it did not do anything. Any help?