POP up

I’m using the kirupa popup script thats inbeded in flash as apposed to on an html page, can anyone help a scripting novice with the code to close this sucker.

Movieclip.prototype.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL (“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open(’” + url + “’,’” + 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 + “))+’” + “’)}else{myWin.focus();};void(0);”);
}

sooo, when I press release on another button the current popup close’s and a new window replaces it.

thanx 4 any help,

swift.:block:

This is just a guess, because I’ve never used the script outside of HTML, but can you use this from inside the popup window:

on(release){
getURL(“javascript:window.close();”);
}

I’m at work, otherwise I would give a quick test run. Let me know if that works for you!!

Thanx 4 reply,

This one is quite tricky,
because the button contains a function call, the function is scripted in a frame, in the function script is the getUrl javascript call.

So what I’m trying to figure is where in the function can you put a javascript call that will close the top most window, because the button to close the popup is in the window below.

Any help would be great.

Cheers,

swift.

all the above script is in the first frame of my swf.

on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = “caveman.html”;
target_winName = “caveman”;
width = 374;
height = 242;
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);
}

all of this script is in the button that calls to the function that opens the popup.

swift.