I am using the java pop up code here at Kirupa. All works well in poping open a single window. The problem is I need to open different pop up windows as needed. My 1st thought was to use a javaclose window command, but thought that might slow things down. How about a way to refreash the already popped up window with the new url.
In your javascript code to open the window… make sure the window name is always the same on each link.
It will then load the new page in the same window.
All the windows MUST be the same size though, because the already opened window will not accept the new width and height, I believe you will need to add a resizeTo in the actual HTML page you are load, not sure if that would work though.
This is the only code I have for poping open my window.
on (press) {
// customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = “http://www.theweb.asp?index="+listbox.getSelectedItem().data["ID”];
target_winName = “win”;
width = 425;
height = 340;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
// sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
So I only have one button that pops open a new window. As the code stands when I hit the button to open a new window the same window pops to the front with the same url/ID.
Well you definitely have to change your script :-\
I have attached a .txt file in this post and my next post to show you 2 different methods of making pop-up windows where you can have more than just one link
A few nights ago we worked on trying to use java pop up commands and passing a query string at the same time.
The Thread is called “java pop up + string query”
It would’t work so you directed me to the Kirupa code that I am using now to pop open the window.
How about this, is there a way to close the window I opened before I open a new window?
well… I’m not pretty good explaining how the codes work.
even more… I’m not good explaining anything.
that’s why I’ll never write any tutorial :-\
but I could give it a try:
lets say that you have to give a name to every function you want to perform. in this case it was myWin.
getURL (“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('” + url + … bla bla bla … + “,top='+((screen.height/2)-(” + h/2 + “))+‘,left=’+((screen.width/2)-(” + w/2 + “))+'” + “')}else{myWin.focus();};void(0);”);
}
as far as I know flash can’t open or close any window by itself… it has to be done through javascript. and the way to use javascript in flash is with getURL
now… why you can’t use the code like you said? that’s because we don’t have any function (window) called Win.
Thanks for the explanation it makes sense well enough to get by:) I have a new problem with the close command, on some computers you get a warning message stating “windows is about to close a window, do you want to do this, YES-NO.”
What setting in IE Internet options makes this happen, none of my computers give the error but for others it does?
And is there any way to stop it from happening all together?
Still know luck on stopping the windows warning message, but I’ll let Kirupa.com know if I find anything.
New issue, It has to do with the same code from the tutorial “Launching a Centered Pop-Up Window.” All is fine until I try to use two sets of pop up code in the same scene.
So, I have one line of code and a button to open a music jukebox, and a second line of code and a button to open a photo gallery, all in the same scene.
The problem is, I click on the button to open the jukebox, and then click on the button to open the photo gallery, the photo gallery will not open. If I then close the jukebox and click on the photo gallery button the gallery opens. The same happens in the reverse.