First of all, my needs:
The main window opens the child window, and the main window has data passed to the Open child window.
Returns the main window directly when the child window closes.
-----------------------------------------------------------------------------------------------
In the beginning, my approach is:
When the main window opens the child window, it this.visible=false immediately, that is, the main window is hidden.
Executes the this.parent.visible=true before the child window closes, showing the main window, then Popupmanager.removepopup (this);.
This method to open the child window is normal, return to the main window is not normal, do not know is God horse reason,
Know the hope to inform one or two.
-----------------------------------------------------------------------------------------------
Then I thought of a way to meet my needs:
1. Open the child window in a modeless manner.
2. Hide the parent window
3. Transmit data to the child window.
4. The child window opens the page where the parent window is located.
-----------------------------------------------------------------------------------------------
The main code for the parent window is as follows:
Copy Code code as follows:
var wnd:desk=new Desk ()//Create child window
Popupmanager.addpopup (Wnd,this,false)//modeless mode Popup
This.visible=false; Hide parent window
wnd.lbdeskid.text=deskid;//Pass data to child windows
wnd.lbdeskpos.text=deskpos;//Pass data to child windows
The main code for the child window is as follows:
Copy Code code as follows:
var strurl:urlrequest = new URLRequest ("socket.html");//Open the page where the parent window is located
Navigatetourl (strURL, "_self");//Open
Popupmanager.removepopup (this) in the same window;//exit child window