Re: [問題] 關於打字音效的控制
很簡單的改寫一下你的程式,把程式寫在一個frame上就好
用function去執行就好,這樣你看應該會簡單很多
在第一個frame上:
function typeTxt(){
count=0;
myid=setInterval(typeRun,200);
}
function typeRun(){
if(count<mystr.length){
count++;
_root.showtxt=mystr.substr(0,count);
mySound.start();
}else{
clearInterval(myid);
}
}
mystr="1234567890abcdefghij";
mySound=new Sound();
mySound.attachSound("soundId");//這裡soundId就是在library裡聲音物件的likage名
稱
在你要觸發的地方呼叫函式就可以了,譬如說在按鈕上
on(release){
typeTxt();
}
這樣寫,你連打字的速度都可自行調整
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.10.51.237
討論串 (同標題文章)
完整討論串 (本文為第 2 之 3 篇):
5
7
Flash 近期熱門文章
PTT數位生活區 即時熱門文章