Here's a version from catbert that worked first time, and I had never done one before. In the head of the html page that holds the main movie, add:
Code:
<*script type="text/javascript">
<*!--
function openWindow(url,name,w,h) {
xPos = (screen.width - w) / 2;
yPos = (screen.height - h) / 2;
config = 'left=' + xPos + ',screenX=' + xPos + ',top=' + yPos + ',screenY=' + yPos + ',width=' + w + ',height=' + h;
newWindow = window.open(url, name, config);
}
//-->
</script>
In the button to open the popup, add:
Code:
on (release) {
getURL("javascript:*openWindow('popup.html','newWin',600,500);");
}
The popup window size is set here. Whatever size it is now, it will open center screen. You can change the size on the button, and the java on the main page will still center it. :)
add; the forum doesn't like my code, so remove the *'s above when you copy.