查看完整版本: AS2.0 關於function
頁: [1]

3171503e 發表於 2011-12-8 08:54 AM

AS2.0 關於function

本帖最後由 3171503e 於 2011-12-9 05:08 PM 編輯

我現在遇到一個大問題...我程式中
function initZomibes()
{
for (i; i < zomibes; i++)
{
attachMovie("zomibe","zomibe" + i,i);
zomibe = _root["zomibe" + i];
updateZomibes(zomibe);
zomibe.onEnterFrame = function()
{
if (this.hitTest(bullets))
{
score += 5;
//trace(score);
bulletActive = false;
removeMovieClip(bullets);
updateZomibes(this);
sc.text = score.toString();

}
if (this._x > 0)
{
this._x -= this.velo;
}
else
{
updateZomibes(this);
}
if(this.hitTest(knight))
{
gotoAndPlay(103);
removeMovieClip(knight);

}

}
}
function updateZomibes(which)
{
which._x = random(100) + 990;
which._y = (0) + 293;
which.velo = random(4) + 3;
}
}
我想讓他在下一個影格停止請問要怎寫??...<div class='locked'><em>瀏覽完整內容,請先 <a href='member.php?mod=register'>註冊</a> 或 <a href='javascript:;' onclick="lsSubmit()">登入會員</a></em></div><div></div>

vinaqc 發表於 2011-12-17 05:52 AM

這問題沒頭沒腦的還真不知道要怎麼回答
看到有個gotoAndPlay(103)
改成gotoAndStop(103)不知道是不是你要的
頁: [1]