guitz
05-27-2003, 02:26 AM
Hello...
I have a JavaScript code wich allows me to open a centered popup window:
<script language="JavaScript"><!--
//openPopup
function openPopup(width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
if (screen.availWidth > 1800) {
x = ((screen.availWidth/2) - width)/2;
}
window.open('http://www.myURL.com','myURL','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left ='+x);
}
//--></script>
I call this script with Flash using this ActionScript method :
getURL ("JavaScript:openPopup(750,450)");
It's pretty usefull if you have one URL to display in your popup, but when I have 10 differents popups with differents URLs, I duplicate 10 times this code in my HTML document, changing the name and the URL, and the result is an heavy HTML document...
So my problem is...
Is there a way to customize this JavaScript :function openPopup(width,height) with the URL too??
For example : function openPopup(URL,width,height)
in order to call it with Flash, with this ActionScript method:
getURL ("JavaScript:openPopup(http://www.myURL.com,750,450)");
Thank you for helping me... :confused:
I have a JavaScript code wich allows me to open a centered popup window:
<script language="JavaScript"><!--
//openPopup
function openPopup(width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
if (screen.availWidth > 1800) {
x = ((screen.availWidth/2) - width)/2;
}
window.open('http://www.myURL.com','myURL','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left ='+x);
}
//--></script>
I call this script with Flash using this ActionScript method :
getURL ("JavaScript:openPopup(750,450)");
It's pretty usefull if you have one URL to display in your popup, but when I have 10 differents popups with differents URLs, I duplicate 10 times this code in my HTML document, changing the name and the URL, and the result is an heavy HTML document...
So my problem is...
Is there a way to customize this JavaScript :function openPopup(width,height) with the URL too??
For example : function openPopup(URL,width,height)
in order to call it with Flash, with this ActionScript method:
getURL ("JavaScript:openPopup(http://www.myURL.com,750,450)");
Thank you for helping me... :confused: