# Window pop-ups

**URL:** <https://forum.kirupa.com/t/window-pop-ups/14167>\
**Category:** Uncategorized\
**Created:** [February 22, 2003, 6:46pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167 "2003-02-22T18:46:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris9902](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@chris9902](https://forum.kirupa.com/u/chris9902)\
**Post date:** [February 22, 2003, 6:46pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167/1 "2003-02-22T18:46:08Z")

</div>

i am making a flash site but on my HTML site i have this window pop-up thing were i can click an image and a window the i can control the size of comes up.

* * *

this is the code if you want to test it to see what i am talking about

* * *

\<html\>  
\<head\>  
\<title\>Untitled Document\</title\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”\>

\<script language=“JavaScript” type=“text/JavaScript”\>  
\<!–  
function GP\_AdvOpenWindow(theURL,winName,features,popWidth, popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { [//v2.0](https://v2.0)  
var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
if (popWidth \> 0) features += (features.length \> 0 ? ‘,’ : ‘’) + ‘width=’ + popWidth;  
if (popHeight \> 0) features += (features.length \> 0 ? ‘,’ : ‘’) + ‘height=’ + popHeight;  
if (winAlign && winAlign != “” && popWidth \> 0 && popHeight \> 0) {  
if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}  
if (winAlign.indexOf(“center”) != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}  
if (winAlign.indexOf(“bottom”) != -1) topPos = h-popHeight; if (winAlign.indexOf(“right”) != -1) leftPos = w-popWidth;  
if (winAlign.indexOf(“left”) != -1) leftPos = 0; if (winAlign.indexOf(“top”) != -1) topPos = 0;  
features += (features.length \> 0 ? ‘,’ : ‘’) + ‘top=’ + topPos+’,left=’+leftPos;}  
if (document.all && borderless && borderless != “” && features.indexOf(“fullscreen”) != -1) features+=",fullscreen=1";  
if (window[“popupWindow”] == null) window[“popupWindow”] = new Array();  
var wp = popupWindow.length;  
popupWindow[wp] = window.open(theURL,winName,features);  
if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
if (document.all || document.layers || document.getElementById) {  
if (borderless && borderless != “”) {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}  
if (alwaysOnTop && alwaysOnTop != “”) {  
ontopIntervalHandle = popupWindow[wp].setInterval(“window.focus();”, 50);  
popupWindow[wp].document.body.onload = function() {window.setInterval(“window.focus();”, 50);}; }  
if (autoCloseTime && autoCloseTime \> 0) {  
popupWindow[wp].document.body.onbeforeunload = function() {  
if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);  
window.onbeforeunload = null; }  
autoCloseTimeoutHandle = window.setTimeout(“popupWindow[”+wp+"].close()", autoCloseTime \* 1000); }  
window.onbeforeunload = function() {for (var i=0;i\<popupWindow.length;i++) popupWindow\*.close();}; }  
document.MM\_returnValue = (ignorelink && ignorelink != “”) ? false : true;  
}  
//–\>  
\</script\>  
\</head\>

\<body\>  
\<a href="#" onClick=“GP\_AdvOpenWindow(‘[http://www.rockstargames.com/vicecity/images/screens/screenD04.jpg’,‘newWindow’,'fullscreen=no,toolbar=no,locatio](http://www.rockstargames.com/vicecity/images/screens/screenD04.jpg','newWindow','fullscreen=no,toolbar=no,locatio) n=no,status=no,menubar=no,scrollbars=no,resizable=no’,640,480,‘center’,‘ignoreLink’,’’,0,’’);return document.MM\_returnValue”\>\<img src=“[http://www.geocities.com/gta\_games/image/cnv.gif](http://www.geocities.com/gta_games/image/cnv.gif)”\</img\>\</a\>  
\</body\>  
\</html\>

* * *

anyway how do i make it so a image in flash can do that, can pop-up a window

thanks for any help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2003, 6:46pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167/2 "2003-02-22T18:46:59Z")

</div>

sorry this is the code

```php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">
<!--
function GP_AdvOpenWindow(theURL,winName,features,popWidth, popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
        if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
        if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
        if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0;                         
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
        ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
        popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
        popupWindow[wp].document.body.onbeforeunload = function() {
              if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
            window.onbeforeunload = null; }  
           autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
      window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow*.close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
//-->
</script>
</head>

<body>
<a href="#" onClick="GP_AdvOpenWindow('http://www.rockstargames.com/vicecity/images/screens/screenD04.jpg','newWindow','fullscreen=no,toolbar=no,locatio n=no,status=no,menubar=no,scrollbars=no,resizable=no',640,480,'center','ignoreLink','',0,'');return document.MM_returnValue"><img src="http://www.geocities.com/gta_games/image/cnv.gif"</img></a> 
</body>
</html>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2003, 10:02pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167/3 "2003-02-22T22:02:59Z")

</div>

make the image into a button. Give the instance of the button the following action:

on (release) {  
getURL(“javascript:GP\_AdvOpenWindow(‘[http://www.rockstargames.com/vicecity/images/screens/screenD04](http://www.rockstargames.com/vicecity/images/screens/screenD04). jpg’,‘newWindow’,‘fullscreen=no,toolbar=no,locatio n=no,status=no,menubar=no,scrollbars=no,resizable=no’,640,480,‘center’,‘ignoreLink’,’’,0,’’);return document.MM\_returnValue”)  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 23, 2003, 9:43pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167/4 "2003-02-23T21:43:28Z")

</div>

thanks mate:bounce:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 23, 2003, 9:49pm UTC](https://forum.kirupa.com/t/window-pop-ups/14167/5 "2003-02-23T21:49:54Z")

</div>

i am getting some weird stuff

i have 4 errors and it may be me but what the f\*\*\* am i doing

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 2:26am UTC](https://forum.kirupa.com/t/window-pop-ups/14167/6 "2003-02-24T02:26:13Z")

</div>

try giving the button this action:

on (release) {  
getURL(“javascript:GP\_AdvOpenWindow(‘[http://www.rockstargames.com/vicecity/images/screens/screenD04](http://www.rockstargames.com/vicecity/images/screens/screenD04). jpg’,‘newWindow’,‘fullscreen=no,toolbar=no,locatio n=no,status=no,menubar=no,scrollbars=no,resizable=no’,640,480,‘center’,‘ignoreLink’,’’,0,’’)”)  
}

Not sure what that one part did, see if it works without it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 25, 2003, 12:04am UTC](https://forum.kirupa.com/t/window-pop-ups/14167/7 "2003-02-25T00:04:30Z")

</div>

these are the errors

* * *

Clipboard Actions: Line 2: String literal was not properly terminated  
getURL("javascript:GP\_AdvOpenWindow(‘[http://www.rockstargames.com/vicecity/images/screens/screenD04](http://www.rockstargames.com/vicecity/images/screens/screenD04). jpg’,‘newWindow’,'fullscreen=no,toolbar=no,locatio

* * *

Clipboard Actions: Line 3: ‘)’ or ‘,’ expected  
n=no,status=no,menubar=no,scrollbars=no,resizable=

* * *

Clipboard Actions: Line 4: ‘;’ expected  
no’,640,480,‘center’,‘ignoreLink’,’’,0,’’)")

* * *

Clipboard Actions: Line 5: ‘;’ expected  
}

* * *

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 12:55am UTC](https://forum.kirupa.com/t/window-pop-ups/14167/8 "2003-02-26T00:55:54Z")

</div>

try adding a “;” at the end of the getURL line (right after the last parenthesis) (without the quotes)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 16, 2003, 9:57am UTC](https://forum.kirupa.com/t/window-pop-ups/14167/9 "2003-05-16T09:57:47Z")

</div>

I know this is kind of an outdated post but…The problem with the errors will be corrected if you put everything from…getURL to the closing parenthesis (i.e. …MM\_returnValue") ) on the same line. Leave the closing bracket (}) on a line by itself.

> \*Originally posted by Big\_Al \*  
> \*\*make the image into a button. Give the instance of the button the following action:

on (release) {  
getURL(“javascript:GP\_AdvOpenWindow(‘[Grand Theft Auto: Vice City - Rockstar Games](http://www.rockstargames.com/vicecity/images/screens/screenD04). jpg’,‘newWindow’,‘fullscreen=no,toolbar=no,locatio n=no,status=no,menubar=no,scrollbars=no,resizable=no’,640,480,‘center’,‘ignoreLink’,‘’,0,‘’);return document.MM\_returnValue”)  
} \*\*

[QUOTE]_Originally posted by Chris9902_

\*\*i am getting some weird stuff

i have 4 errors and it may be me but what the f\*\*\* am i doing\*\*
