的Flex / AIR,如何在UI控件,按钮等设置重点是什么? [英] Flex / AIR, how to set focus on a UI Control, Button, etc?

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

问题描述

所以,我试图当应用程序启动(或更新的基于特定事件)上的特定按钮设置焦点,使得用户可以简单地击中返回preSS的按钮。但是,没有一个下列方法工作。

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(事件:FlexEvent):无效
{
    //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天全站免登陆