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 to understand the data exchange between Flex pop-up window and child parent Flex window

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article to share with you is about how to understand Flex pop-up window implementation and child parent Flex window data exchange, Xiaobian think quite practical, so share for everyone to learn, I hope you can read this article after harvest, not much to say, follow Xiaobian to see it.

Implementation of Flex Pop-up Window and Data Exchange between Child and Parent Flex Window

Flex uses PopUpManager.createPopUp(parent,class,modal[,initobj,outsideEvents]) to create a parent child Flex window. The parameters of this function are described as follows:

parent A reference to the Flex window in which the pop-up Flex window is located.

class A reference to the class of the object to be created.

modal A Boolean value indicating that the Flex window is true or false.

initobj An object containing initialization properties. This parameter is optional.

OutsideEvents A Boolean value that indicates whether (true) or (false) the event is triggered when the user clicks outside the Flex window. This parameter is optional.

The first three parameters are mandatory and the last two are optional. The second parameter must match the name of your mxml file. The third parameter, if yes, does not allow the parent Flex window to be manipulated until the Flex window is closed. Otherwise, it is allowed.

◆ First we create a page, the key code is as follows:

functionshowWindow(modal) { varpopup=mx.managers.PopUpManager.createPopUp(_root,login,modal,{deferred:true}); }

Then we create a TitleWindow, notice that although it is also an mxml file, its rating element is not Application but TitleWindow, and the rest is the same as before.

The following describes the data exchange of the child parent Flex window.

The parent Flex window gets an instance of the child Flex window when the child Flex window is created, notice the variables I marked with red children. We can use this variable to refer to global variables defined in the child Flex window. For example, I define it as follows in the child Flex window: varname:String="haha";. The variable can be referenced in the parent Flex window using popup.name.

Similarly, in a child Flex window we can use "parent" to refer to variables defined in the parent Flex window, for example I define varage:String="24"; in the parent Flex window. This variable can be referenced in a child Flex window using parent.age.

The above is how to understand the data exchange between Flex pop-up window implementation and sub-parent Flex window. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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