Solved

Geting parent document object, while calling a new page from flash.

Posted on 2007-03-20
6
211 Views
Last Modified: 2008-03-06
Hey Experts!

I have a ParentWindow (asp page\ which contains a Flash Movie, when user clicks on a link on Flash Movie it opens a PopupWindow. Now I want to execute a script located on ParentWindow when PopupWindow gets closed.

Need urgent reply.
0
Comment
Question by:imrancs
6 Comments
 
LVL 10

Assisted Solution

by:Jaax
Jaax earned 200 total points
ID: 18754713
In your popup you should have

<script>
 function fnExecuteMainFunc(){
   window.opener.parentWinFunc(); // parentWinFunc is the function in the parent window
}
</script>

<body onunload="fnExecuteMainFunc()">
.....

</body>
0
 
LVL 10

Author Comment

by:imrancs
ID: 18754768
window.opener.someFunction();

This gives null reference to the parent window.
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18754913
I think the pop-up is not opened by a javascript but by some other means. Would it be possible for you to open the pop-up using javascript code
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 63

Expert Comment

by:Zvonko
ID: 18755036
You neen to do two things:
1.) Give the parent window a name by script. Do that by placing on parent page anywhere this script:
<script>window.name="flashWindow";</script>

If the parent window is a Frame or Iframe, then upper script line is not neccessary. Then you need the frame or iframe name. If you do not know the name find the name like this:
<script>alert(window.name);</script>

2.) On the popup window where you want to call the parent window function do this script:
<script>
function callParenFunction(){
   var parentWindow = window.open("","flashWindow","top=90000");
   parentWindow.yorParentWindowFunctionName();
}

callParenFunction();
</script>




0
 
LVL 5

Accepted Solution

by:
Qaiser_Mehmood_Mughal earned 300 total points
ID: 18755181
Okey.
If you are opening the popupWindow from flash movie then "Jaax" Code will be worked.

and if you are just opening the new window not popup then the "Jaax" code will not worked.

so just tell me first is you are opening the popup window or new window using link.

if you are just opening the new window then open popup to find the right solution.

here is the code to open the popup window from flash movie.

--------------------------------------------------------------------------------
place this code in action of the button or link button on press
on (press){
fscommand("popup", "http://www.macromedia.com/");
}

then include the following script tag in ur parent window.
<script Language="JavaScript" event="FSCommand (command, args)" for="theMovie">
if (command == "popup") {
    window.open(args, "mmwin", "width=500,height=300");
}
</script>

I think this will help you.


0
 
LVL 10

Author Comment

by:imrancs
ID: 18755199
thanx for Qaiser Mehmood Mughal and Jaax
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Initialize SharePoint Online List Values in Quick Edit 7 23
Angular - break the dataset in chunks? 7 39
is this a cms? 8 35
Having problem getting this to work 2 21
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now