Flex/AIR,如何将焦点设置在 UI 控件、按钮等上? [英] Flex / AIR, how to set focus on a UI Control, Button, etc?

查看:18
本文介绍了Flex/AIR,如何将焦点设置在 UI 控件、按钮等上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我试图在应用启动时(或稍后基于某些事件)将焦点设置在特定按钮上,以便用户只需按回车键即可.但是,以下方法均无效.

So, I'm trying to set focus on a specific button when the app launches (or later based on certain events), so that the user can simply hit return to press the button. None of the following approaches work however.

<代码>受保护的函数 group1_creationCompleteHandler(event:FlexEvent):void
{
//btnBrowse.setFocus();
focusManager.setFocus(btnBrowse);
}

protected function group1_creationCompleteHandler(event:FlexEvent):void
{
//btnBrowse.setFocus();
focusManager.setFocus(btnBrowse);
}

推荐答案

尝试:

protected function group1_creationCompleteHandler(event:FlexEvent):void
{
  callLater(btnBrowse.setFocus);
}

这篇关于Flex/AIR,如何将焦点设置在 UI 控件、按钮等上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆