0
我最近採取了編程和遇到問題,當涉及到分數顯示。分數沒有問題遞增並顯示它只是因爲分數更新它不會刪除最後的分數。十幾幀後,我顯示了一堆亂七八糟的分數。我花了幾天谷歌搜索,看看我能找到任何類型的答案,但沒有看到類似這樣的問題。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),但是當我想這也沒有顯示比分更新。
謝謝
非常感謝!添加更改後,我不再有這個問題。 – 2012-03-20 06:06:39