there are many different ways you could do this. here's one:
PHP Code:
button.addEventListener(MouseEvent.CLICK, quadClick, false, 0, true);
var clickCount:uint = 0;
var timer:Timer = new Timer(3000);
timer.addEventListener(TimerEvent.TIMER, stopQuadClick, false, 0, true);
function stopQuadClick(event:TimerEvent):void{
button.removeEventListener(MouseEvent.CLICK, countClicks);
button.addEventListener(MouseEvent.CLICK, quadClick, false, 0, true);
timer.stop();
}
function quadClick(event:MouseEvent):void{
clickCount = 0;
timer.start();
button.removeEventListener(MouseEvent.CLICK, quadClick);
button.addEventListener(MouseEvent.CLICK, countClicks, false, 0, true);
}
function countClicks(event:MouseEvent):void{
clickCount++;
if(clickCount == 3){
trace("clicked 4 times in 3 seconds");
stopQuadClick(null);
}
}