【问题标题】:As3 enter key should be work as tabAs3 输入键应该作为选项卡工作
【发布时间】:2014-10-23 02:10:41
【问题描述】:

我已经在我的 Adob​​e Air 中设置了 TexInput 控件的 tabindex 可以正常使用 tab 键。现在我想用回车键做同样的事情。我的意思是当我在 TextInput 中按下回车键时,应该选择下一个控件。

在 C# 中,我们可以对 SendKeys 执行相同的操作,据我所知,Adobe Air 中没有这种方式。

这是我添加的活动

// get key presses only when the textfield is being edited
inputText.addEventListener(KeyboardEvent.KEY_DOWN,handler);
function handler(event:KeyboardEvent){

// if the key is ENTER
if(event.charCode == 13){

   // WHAT ???
}
}

【问题讨论】:

    标签: actionscript-3 air textinput


    【解决方案1】:
    1. 使用下一个/上一个 tabIndex 查找实例
    2. 根据您使用的控件,可以在该控件上调用 setFocus() 方法(如果有),或者将舞台的焦点属性设置为此实例。如果您想完全移除焦点,请将其设置为 null。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多