PDA

View Full Version : Problem opening a new window from a popup window


Jungl3M4n
12-12-2001, 07:48 PM
Hello fellas, I was reading the posts about popup windows and spawn windowns and no one fix my problem.

now what is the thing that has made this post to accur.

I have a flash movie opened in a popup window, now from the swf file I want to open a new browser window(Popup too) with some other stuff.

my code to popup the main movie:



<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {

var MyBrowser = navigator.appName;

if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);

var myWin = window.open(page,"MainWin","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
else {

var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);

var myWin = window.open(page,"MainWin","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
myWin.focus();

}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>


and from the page that is open i will have to call another html pages and the code remains the same just change the function from PopupWin to PopupWin2

and nothing happens it still load in the same window and that DOESNT HAVE TO HAPPEN because you know :p

Please help.

maybe there is any way to set up that javasctipt to open in a

getURL("javascript:PopupWin2('........')","_blank");


or something.

Jungl3M4n
12-12-2001, 07:56 PM
I have tested that about ","_blank"); and doesnt work.

This reply is to share with all of you that the code opens the popup window centered in the monitor no matter wich resolution the visitor have.

Ir is great.

Please help ASAP.

Greets,
:D :D

Jungl3M4n
12-12-2001, 08:15 PM
Thanks anyway.

The problem was here.

Remember the code???




<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {

var MyBrowser = navigator.appName;

if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);

var myWin = window.open(page,"MainWin ","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
else {

var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);

var myWin = window.open(page,"MainWin ","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
myWin.focus();

}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>


take a look at the feature where the name of the window is set.

well it have to be changed, if no the browser will asume that you are oppening the new html file in the same window.

:)
:)
:)

:D :D :D :D

Enjoy the code and use it people its verry nice to open the popup windows centered.

Greets,

Jungl3M4n
12-12-2001, 08:16 PM
Thanks anyway.

The problem was here.

Remember the code???




<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {

var MyBrowser = navigator.appName;

if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);

var myWin = window.open(page,"MainWin ","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
else {

var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);

var myWin = window.open(page,"MainWin ","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resiz able=0,titlebar=no");

}
myWin.focus();

}

function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>


take a look at the feature where the name of the window is set.

well it have to be changed could be something likeMainWin2, if no the browser will asume that you are oppening the new html file in the same window.

:)
:)
:)

:D :D :D :D

Enjoy the code and use it people its verry nice to open the popup windows centered.

Greets,