0

我正在尝试为我的 AIR 应用程序实现 Stagetext 输入,但遇到了一个巨大的错误。

当我在输入框中键入时,例如“测试”字符开始重复自己,当我尝试删除它们时,它们不断重复。

有解决办法吗?我什至应该将 Stagetext 用于本机输入吗?

下面的代码

function login()
{
    var usernameBox = new Sprite();
    var passwordBox = new Sprite();
    var usernameInput:StageText = new StageText();
    var passwordInput:StageText = new StageText();

    usernameBox.graphics.lineStyle(4, 0x000000, 1);
    usernameBox.graphics.beginFill(0xFFFFFF, 1);
    usernameBox.graphics.drawRect(6, 44, stage.stageWidth-12, 70);
    this.addChild(usernameBox);

    passwordBox.graphics.lineStyle(4, 0x000000, 1);
    passwordBox.graphics.beginFill(0xFFFFFF, 1);
    passwordBox.graphics.drawRect(6, 130, stage.stageWidth-12, 70);
    this.addChild(passwordBox);

    usernameInput.returnKeyLabel = ReturnKeyLabel.DONE;
    usernameInput.autoCorrect = true;
    usernameInput.restrict = "a-zA-Z0-9_\\-";
    usernameInput.fontSize = 40;
    usernameInput.color = 0x440000;
    usernameInput.stage = stage;
    usernameInput.viewPort = new Rectangle(10,50,stage.stageWidth-20,70);

    passwordInput.returnKeyLabel = ReturnKeyLabel.DONE;
    passwordInput.autoCorrect = false;
    passwordInput.restrict = "a-zA-Z0-9_\\-";
    passwordInput.fontSize = 40;
    passwordInput.color = 0x440000;
    passwordInput.displayAsPassword = true;
    passwordInput.stage = stage;
    passwordInput.viewPort = new Rectangle(10,136,stage.stageWidth-20,70);
}
4

0 回答 0