Solved

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

Posted on 2007-03-20
6
218 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generate Numbers in JQuery file 11 66
How to make button inactive until I fill in all the boxes. 11 19
ASP exit 10 19
Non-Resizable Pharagraph 2 7
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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.
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…

829 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