2016-12-10 50 views
-1

GETTIME我想代碼AS2轉換爲AS3。如何在ActionScript 3

timeFaktor = 4; 

function timeReset() { 
    delete curretnTime; 
    delete showtTime; 
    currentTime = new Date(); 
    showTime = new Date(); 
    startingTime = false; 
    pauseTime = 0; 
    txt_Time.text = "t = "+0+" s"; 
} 

function moveTime() { 
    delete currentTime; 
    currentTime = new Date(); 
    if (!startingTime) { 
     starTime = currentTime.getTime(); 
     startingTime= true; 
    } 
    newTime = Number(currentTime.getTime()-starTimeMulai)+Number(pauseTime); 
    secon = newSecon/1000; 
    time = (Math.round(detik*100))/100; 
    txt_time.text = "t = "+time+" s"; 
} 
+1

_「我要你檢查我的代碼是正確的......」 _什麼** **究竟是我們檢查?告訴我們,你試圖讓&問一個** **具體問題有關您的代碼的問題...... –

+0

這是正確的,如果它做你想讓它什麼AS3版本代碼。但是,因爲你還沒有描述你想要它做的那麼我們不能回答這個問題的。至於AS2到AS3,我沒有看到你的代碼,任何會被這兩個版本之間的不同,但AS2是很久以前的我,所以我不能肯定。但也有在你的代碼中沒有明顯的語法錯誤,我可以看到。 –

回答

1

這只是說,ketapel1不是一個函數,但你是通過嘗試傳遞它的參數來對待它。

ketaple1(parameter1, parameter2, ...); 

的Flash看到這一點,並說:「兒子正在努力將參數傳遞給這件事情就像是一個功能」,並引發錯誤。

第二個錯誤是說Xo尚未確定。它看起來沒有。將這些值定義在任何其他函數之外。

因爲我不知道是什麼XO或ketaple是我不禁超過該