Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Flex pops up

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how the Flex pop-up window, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Flex pop-up window

This is more powerful, you need to use a class, that is, PopUpManager, again, you need to import before using:

Importmx.managers.PopUpManager

Then you have to create a Compoment as a pop-up window, this is nothing special, just create a normal Compoment, here I created a file called PopWindow, which is a simple Canvas, in which there is a picture. The code is as follows:

PopWindow.mxml:

One of the methods of PopUpManager is removePopUp, which is to remove the current Flex pop-up window. Here I set it to remove the pop-up window when you click on the image. Next, we create and Flex the pop-up window in the main program:

Varpop:PopWindow=PopWindow (PopUpManager.createPopUp (this,PopWindow,true))

This is done. The pop is a variable of type PopWindow (that is, the file name of the Component you just created). Since the createPopUp of PopUpManager returns an IFlexDisplayObject, you need to cast it to the PopWindow type to assign a value to the pop variable.

◆, let's describe these parameters of createPopUp in detail:

* the parameter is the parent form of the Flex pop-up window, which we all know.

The second parameter is the class name of the Flex pop-up window, that is, the file name of the component, and a MXML file corresponds to a class in Flex. PopUpManager creates pop-up dialogs based on this class.

The third parameter is the modal marker. If it is true, create a modal dialog box; otherwise, create a modeless dialog box.

PopUpManager also has a parameter, but it is not commonly used. Please refer to the help documentation for details.

Then you can operate on the pop-up dialog and use removePopUp (pop) if you want to remove it. In addition, if it is modeless, the window may disappear when you click on the rest of the program, but it has not been removed, so how do you get it out? At this point, you need another method of PopUpManager: bringToFront (), which puts the window at the front. You can control that the program creates a dialog box for the next time, and then puts the window at the front.

Thank you for reading this article carefully. I hope the article "how to Flex Pop-up window" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report