PDA

View Full Version : Pop up replacenent problem



WndrngDragon
March 4th, 2005, 10:51 PM
im having a big problem with my pop ups. at the moment i am using the code form this tutorial (http://www.kirupa.com/developer/mx/centered_popup.htm). The windows pop up, the problem lies in that the pop ups wont replace each other. if one pop up is open, trying to open another one just makes the old pop up active, it doesnt open the contents of the new one. this is a big problem since the pop ups are for my portfolio to show the work at larger sizes. is there a way to tell the new pop up to close the old one and then open? would this be some sort of if... else statment? or is there some other code i should use for the pop ups? either way, please tell me how to do this, i am not good at any type of programming. thanks!

~dragon

WndrngDragon
March 5th, 2005, 07:39 PM
ok, i sort of got this to work with a little help from a friend, and heres the new script: (i hope the tags are right)

main code


_root.openWinCentre = function (url, winname, target_winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ("javascript: var mywin; if(!document.winname || winname.closed){mywin = window.open('" + url + "','" + winname + "','" + target_winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "'); openwin = winname;}else{mywin.focus();};void(0);");
}


button code


on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "files/problems.html";
winname = "problems";
target_winName = "_blank";
w = 360;
h = 460;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
//sends data back to the function
openWinCentre(address, winname, target_winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable);
}


the new problem is that while i can get more than one pop up now, they arent coming up the correct size. im also getting an error message that 'winname' is undefined. any ideas?