# Misalignment of JPG using Tutorial of Centered Popup Window

**URL:** <https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155>\
**Category:** Uncategorized\
**Created:** [February 20, 2004, 9:04am UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155 "2004-02-20T09:04:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chito](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Chito](https://forum.kirupa.com/u/Chito)\
**Post date:** [February 20, 2004, 9:04am UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/1 "2004-02-20T09:04:11Z")

</div>

Hi guys, this is my first post here. These forums have been a great read the past week 🙂

I have done a search and haven’t found an answer, so I thought I’d ask here.

I used the tutorial on this site to create a centered popup window, and it works! However, when I try to use a “\*.jpg” extension so that the window just displays a picture I have, it misaligns the picture so that there is a white border on the left and top of the picture. This doesn’t happen when I enter a destination that is an HTML file.

Does anyone know how I can fix this? I don’t have to create an HTML file for every JPG I have, which just has code to embed a picture in it, do I? That would be a lot of files!

Thanks in advance,

Chito

---

<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 20, 2004, 3:53pm UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/2 "2004-02-20T15:53:29Z")

</div>

hi, welcome!  
you probably are going to have to make a page for each photo. I just don’t think you have the same amount of control over formatting with .jpg, like you would have with a .html extension.  
If you knew a serverside language you could code just one page, and load all the photos into that, but that would require a host that supported a servide language like php or asp (etc).

\*also I wouldn’t really consider this a ‘flash’ question, you probably would have gotten better results from posting this in the ‘client side’ forum

---

<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 20, 2004, 5:02pm UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/3 "2004-02-20T17:02:56Z")

</div>

Pass the file name as a query string and use one single html to pick up the correct file to load.

---

<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 20, 2004, 8:03pm UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/4 "2004-02-20T20:03:03Z")

</div>

Thanks for the replies 🙂 I’m sorry… what type of questions goes into the “client side” forums?

Should I repost this question there? Because I really have no clue what Claudio just suggested I do ☹ I dont’ know how to pass a query string.

Thanks,

Chito

---

<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 21, 2004, 11:32pm UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/5 "2004-02-21T23:32:17Z")

</div>

Replace the prototype on your fla for this one:

```auto
Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
	getURL("java **** script:var myWin; if(!myWin || myWin.closed){myWin = window.open('popup.html?"+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);");
};

```

Now save the following piece of code with the name _popup.html_. Place it in the same folder as your swf.

```auto
<html>
<head>
<title>
</title>
</head>
<body>
<script language="javascript">
document.write("<img src='"+location.search.slice(1,location.search.length)+"'>");
</script>
</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 23, 2004, 6:52am UTC](https://forum.kirupa.com/t/misalignment-of-jpg-using-tutorial-of-centered-popup-window/102155/6 "2004-02-23T06:52:25Z")

</div>

Welcome 🙂
