0
나는 최근에 프로그래밍을 시작했으며 점수 표시와 관련하여 문제가 발생했습니다. 점수는 점차 증가하지 않고 점수를 업데이트해도 마지막 점수는 삭제되지 않습니다. 12 개의 프레임 이후에는 나는 혼란스런 점수를 표시했다. 나는 어떤 유형의 답을 찾을 수 있었는지보기 위해 며칠 동안 구글을 검색했지만, 이와 비슷한 문제는 보지 못했다.모든 점수를 보는 AS3
내 코드 : 내
public function balldistance(event:Event){ // function called on ENTER_FRAME in order to update the distance of the ball object
var txt:TextField = new TextField();
txt.text = "Distance: " + String(balldist);
txt.x = 25;
txt.y = 25;
addChild(txt);
trace(balldist); // I added this line in my code for troubleshooting purposes just so I could see the balldist augment.
balldist += Ball5.dx; // I am having the score(balldist) augment based on the distance the ball has traveled from its starting point.
}
친구가로 removeChild (TXT)를 제안하지만 난이 시도 때 점수 업데이트를 보이지 않았다.
는 때마다 ENTER_FRAME가 트리거되는 새로운txt:TextField
를 작성하는 것처럼 당신이
대단히 감사합니다! 변경 사항을 추가 한 후에는 더 이상 그 문제가 없습니다. –