【问题标题】:Placing cursor (blinking caret) into input TextField for user input in AS3.在 AS3 中将光标(闪烁的插入符号)放入输入 TextField 以供用户输入。
【发布时间】:2010-12-26 15:52:56
【问题描述】:

在事件发生后将光标(焦点?)放入Input TextField 接收用户输入的最简单方法是什么? Focus Manager 课程对我来说似乎总是很困惑。

【问题讨论】:

    标签: actionscript-3 actionscript


    【解决方案1】:

    好消息:在 as3 中没有焦点管理器,只需使用舞台:

    stage.focus = textField;
    textField.setSelection(textField.text.length,textField.text.length); //place caret at end of text
    

    【讨论】:

    • 顺便说一句(不是批评你的回答很好),我认为有一个 FocusManager 类,但它是用于组件的,在这里不合适。如果他们正在浏览 AS3 语言参考,我认为这会让人们感到困惑。
    • 问题可能出在 IDE 中,请尝试在生产环境中使用此解决方案。尝试在浏览器或任何其他播放器中使用已编译的 .swf 文件。
    猜你喜欢
    • 2017-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 1970-01-01
    • 2013-02-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多