Solved

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

Posted on 2007-03-20
6
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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…

751 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