2012-09-06 2 views
0

클래스에 연결되어 배열로 가져온 하위 동영상 클립의 애니메이션을 어떻게 변경합니까?Manage class MovieClip

은 지금은 선수가 안타 때이 라인, 그것을 사라지게 할 수 있어요 : 그것을 봐가있는

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 기능. 외부 파일 :

this.parent.gotoAndPlay(2); 

하지만 내가 잘못, 도와주세요하고 있어요 :

this.parent.removeChild(this); 

같은 사람 :

public function removeSelf():void 
{ 
    trace("Removed"); 
    removeEventListener(Event.ENTER_FRAME, loop) // Sustabdyti loop 
    this.parent.removeChild(this); // panaikinimas 
} 

나는이 라인을 변경해야한다고 생각.

답변

0
this.parent.gotoAndPlay(2); 

은 광산의 부모의 두 번째 프레임에서 플래시로 이동하고 재생한다는 의미입니다. 당신은 그것의 두 번째 프레임에서 광산을 재생하려면 당신은 항상 범위 또는 당신이 제대로 할 일들을 보장하기 위해 액세스를 확인

this.gotoAndPlay(2); 

아래에 뭔가를 작성해야합니다.