【问题标题】:Adobe AIR 2 not detect enter inside TLF TextFieldAdobe AIR 2 未检测到 TLF TextField 内的输入
【发布时间】:2011-07-29 22:18:01
【问题描述】:

此代码在 flash 中工作,但是当我尝试使用 adobe air 2 运行时,未检测到 enter 键,而是 ctrl+enter 工作。如何获得这项工作?提前提

txtTLF 是 TLF 文本可编辑

import flash.events.TextEvent;

txtTLF.addEventListener(TextEvent.TEXT_INPUT, teclado);
function teclado(e:TextEvent):void{
    if(e.text == String.fromCharCode(13)){
        e.preventDefault();
        code();
    }
}

【问题讨论】:

    标签: flash air tlf


    【解决方案1】:

    我找到答案了,别忘了,代码是:

    txtTLF.addEventListener(KeyboardEvent.KEY_DOWN, teclado, true);
    function teclado(e:KeyboardEvent):void{
        if(e.keyCode == 13){
            e.preventDefault();
            code();
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-09
      • 2011-05-26
      相关资源
      最近更新 更多