クラスに関連付けられ、配列にインポートされた子ムービー クリップのアニメーションを変更するにはどうすればよいですか?
現在、プレーヤーがヒットすると、次の行で消えるようにすることができます。
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
}
}
ここでは、as にある 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);
しかし、私はそれを間違っています、助けてください。