且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Flex 中设置焦点

更新时间:2022-01-28 09:37:58

问题是在您的应用程序中 TextInput 具有焦点,但在 HTML 页面中您的 Flex 应用程序没有.所以基本上你唯一需要的额外步骤就是让 Flex 应用程序成为焦点.只有一种方法可以实现这一点:通过 JavaScript.您应该在加载应用程序之后执行此操作.

The issue is that within your application the TextInput has focus, but within the HTML page your Flex application does not. So basically the only extra step you need is to give the Flex app focus. There's only one way to achieve this: through JavaScript. And you should do it after the application was loaded.

Farrata 的人写了一个很好的例子来说明如何做到这一点,所以我只是想给你指出:http://flexblog.faratasystems.com/2011/12/15/setting-focus-in-flex-components

The guys at Farrata wrote a very good example on how to do this, so I'm just going to point you there: http://flexblog.faratasystems.com/2011/12/15/setting-focus-in-flex-components