在Flash AS2中显示HUD上的分数

时间:2014-11-02 09:36:53

标签: flash actionscript-2 hud dynamic-text

我真的需要帮助(解释)在Flash中使用动态文本。我试图在游戏中显示HUD的当前得分时遇到困难。我仍然是Flash的新手,所以任何帮助都会受到赞赏。

1 个答案:

答案 0 :(得分:0)

以下是文字字段currentScore显示的当前得分示例 当有人点击舞台时:

var p:int = 0; // score points

function clickHandler(e:MouseEvent):void {
    p++;
    currentScore.text = String(p);
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);