Centerred PopUp Windows - Help

Hi,

I have followed the tutorial on Kirupa.com located here:

http://http://www.kirupa.com/developer/mx/centered_popup.htm

Which tells you how to open up a centered HTML window from Flash MX using actionscript and Javascript.

No problems with that - it works.

On my site I have a portfolio section.
When the user clicks a certain project I want a centerred pop-up window to open displaying that project. This again works fine regardless of which project they click.

** Code **

The code to get the window working is explained in the tutorial but is here incase you can’t be bothered to look. - I have shortenned the part attached to the frame because it wouldn’t fit on the screen properly .

You attch this to the button:

[AS]
on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = “http://www.kirupa.com/modular/pop-up.htm”;
target_winName = “kirupa”;
width = 400;
height = 300;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar,
location, directories, status, menubar, scrollbars, resizable);
}
[/AS]

and this to a frame:


_global.openWinCentre = function
(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable)
 {
        getURL("javascript:window.open(Paramaters)");
}

** Problem **

If say “project 1” is open in the centerred pop-up window, and they click “project 2” I want “project 2” to be displayed in THIS window with the proportions I specify. I have tried alterring the code but have given up because I have no idea how to get this working - “project 1” remains in the window. The only way I can get “project 2” to show is to shut the window, and then click the “project 2” button.

Alternatively I wouldn’t mind “project2” opening up in a DIFFERENT pop-up centerred window with the proportions I specify - However this doesn’t work either even though I have called the window a different name. Its like will only allow me to have 1 centerred pop-up window open ??

I was thinking one way to do this is if a different button is pressed the centtered pop-up window shuts and then a new one opens. I have tried doing this with javascript from Flash but again can’t get it working.

If Anyone can help me I would be very greatful, thanks.