2010-06-06 52 views

回答

0

只看該代碼..

有一個startRecord功能

function startRecord(){ 
    setFPS(); 
    state = 2; 
    disableAction(); 
    timer = window.setInterval('pushCoordinates()', Math.floor(1000/fps)); 
    document.getElementById('console').value = ''; 
    window.onmousemove = grabCoordinates; 
} 

和stopRecord功能:

function stopRecord(){ 
    window.clearInterval(timer); 
    saveCoordonnees(); 
    state = 0; 
    enableAction(); 
    document.getElementById('which').selectedIndex = 0; 
} 

你可以probalby使按鈕與觸發pauseRecord 以及類似於

function pauseRecord(){ 
    //stop the timer 
    window.clearInterval(timer); 
} 

,然後一個觸發resumeRecord

function resumeRecord() { 
    //start the timer again 
    timer = window.setInterval('pushCoordinates()', Math.floor(1000/fps)); 
    window.onmousemove = grabCoordinates; 
} 
+0

感謝您的答覆。但是我問是否可以添加暫停和繼續功能來播放鼠標移動而不是錄音。 – peter 2010-06-07 06:03:34