0
如何更改與某個類關聯的子影片剪輯的動畫,並將其導入數組?管理類MovieClip
現在我能當玩家點擊它,使其dissapear,這條線:
this.parent.removeChild(this);
有看看吧,有哪個是進口與外部的2個礦。文件,並在MineList數組中。
http://teroute.com/stronghold/index.php?page=secret-project
我想使觸摸時這些水雷爆炸。
在此,更多的代碼:
for (var i:int = 0; i < MineList.length; i++) // Here i count all mines, that are in MineList Array
{
if(player.hitTestObject(MineList[i])) // If player touches any mine
{
MineList[i].removeSelf(); // If player touches a mine,
// then this mine will dissapear
}
}
這裏一個removeSelf功能,該功能爲。外部文件:
public function removeSelf():void
{
trace("Removed");
removeEventListener(Event.ENTER_FRAME, loop) // Sustabdyti loop
this.parent.removeChild(this); // panaikinimas
}
我覺得這一行應改爲:
this.parent.removeChild(this);
喜歡的東西:
this.parent.gotoAndPlay(2);
但我做錯了,請幫助。