简体   繁体   English

Flex-如何获取当前打开的Air Window标题列表(或检查特定的窗口标题)?

[英]Flex - how to get a list of Air Window titles that are currently open (or check for a specific window title)?

In my Flex (Flash Builder 4.6) application, I am opening an Adobe AIR "Window" object, via: 在我的Flex(Flash Builder 4.6)应用程序中,我将通过以下方式打开Adobe AIR“窗口”对象:

myWindowObject = new MyWindow(); myWindowObject = new MyWindow(); // this is a "" myWindowObject.title="custom window title here"; //这是一个“” myWindowObject.title =“此处的自定义窗口标题”; myWindowObject.open; myWindowObject.open;

In the application, the user may open several windows. 在应用程序中,用户可以打开几个窗口。 I need to prevent the user from opening the same window twice. 我需要防止用户两次打开同一窗口。 So I either need an ability to check for the existence of a window currently open with a specific title, OR get a list of all the open windows, and then I could look at that list to see if it's already open. 因此,我要么需要检查当前是否已打开带有特定标题的窗口,要么获得所有打开的窗口的列表,然后我可以查看该列表以查看其是否已经打开。

How can I get a list of the window titles, or check for a window with a specific title? 如何获得窗口标题的列表,或检查具有特定标题的窗口?

The Air framework provides an Array of all opened windows: Air框架提供了所有打开的窗口的数组:

FlexGlobals.topLevelApplication.nativeApplication.openedWindows;

You can iterate through these and check the title of each and do with it as you wish. 您可以遍历这些并检查每个标题,并根据需要进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM