# Opening links in presized windows?

**URL:** <https://forum.kirupa.com/t/opening-links-in-presized-windows/5424>\
**Category:** Uncategorized\
**Created:** [September 11, 2002, 1:51am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424 "2002-09-11T01:51:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![toadclipper](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@toadclipper](https://forum.kirupa.com/u/toadclipper)\
**Post date:** [September 11, 2002, 1:51am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/1 "2002-09-11T01:51:52Z")

</div>

I have all my links and swf files set up like this for the links:

on (release) {  
getURL(“flash/MCTransitionsButtonsMove.swf”, \_blank);

}

what I want is to have the swf files open in smaller sized windows with a button to close the window.

Could someone tell me how to do this?

thank you

---

<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:** [September 11, 2002, 2:16am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/2 "2002-09-11T02:16:13Z")

</div>

You mean like a pop-up window with a close window link inside that window?

If so, I have included the popular pop up window text file I wrote for someone else on this forum that needed to know how to do it. That will teach you how to create a pop-up window.

as for closing a window it goes like this…

```php

<A HREF="javascript:close();">Close Window</A>

```

PS: I am moving this to the HTML/Javascript 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:** [September 11, 2002, 2:23am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/3 "2002-09-11T02:23:31Z")

</div>

A HREF=“java script:close();”\>Close Window\</A

on the button action itself. I am only opening swf file’ that are not contained in html. Do I create a button as with the others and as for the action of that button put that line of code. Also, is this PHP?

This is javascript. What Im looking for is a way to close a window from within an swf movie.

---

<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:** [September 11, 2002, 2:25am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/4 "2002-09-11T02:25:30Z")

</div>

Oh ok, I thought it would be HTML… in that case…

```php

getURL("javascript:close()","_self")

```

Or something along those lines.

This isn’t PHP, but as you can see, the only way to keep HTML from converting is to use the PHP tags to show 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:** [September 11, 2002, 2:30am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/5 "2002-09-11T02:30:36Z")

</div>

I’ll try it now:)

---

<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:** [September 11, 2002, 2:36am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/6 "2002-09-11T02:36:50Z")

</div>

Let me know if it works. And if there are any problems I am sure I will be able to help you out.

---

<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:** [September 11, 2002, 2:37am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/7 "2002-09-11T02:37:21Z")

</div>

that did not work;  
I tried it like this:

getURL(“java script:close()”,"\_self")

and got this error:

“Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement must appear within on handler  
getURL(“java script:close()”,”\_self")"

Then like this and it says it can’t find the url:  
on (press) {  
getURL(“java script:close()”,"\_self")  
}

What am I doing wrong?

---

<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:** [September 11, 2002, 2:44am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/8 "2002-09-11T02:44:02Z")

</div>

Are you testing this in Flash or on the Published HTML page? If you test from inside Flash, it will not work. If you test it on the HTML page that you publish, it will work.

Your last method was correct. The on(press) one.

\<B\>EDIT:\</B\> Why are you loading the .swf files into the pop-up windows? You should load an .html file that contains the .swf. Is it because of the white margin around the movie? If so, I will tell you how to get rid of that.

---

<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:** [September 11, 2002, 2:57am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/9 "2002-09-11T02:57:45Z")

</div>

It is because of that margin that i did not want to open in html. Please tell me how?

thank you

---

<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:** [September 11, 2002, 3:01am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/10 "2002-09-11T03:01:16Z")

</div>

Ok, getting rid of the margins in HTML are very easy. You will need to open up your .html file (an basic text edit works, even WordPad). Find the tag that says

```php
<body>

```

and change it to say

```php
<body topmargin="0" leftmargin="0">

```

If you want to go all out and wipe out everything about margins it goes like this…

```php
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

```

I hope this helps you out:)

---

<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:** [September 11, 2002, 3:34am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/11 "2002-09-11T03:34:51Z")

</div>

I will try this now

---

<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:** [September 11, 2002, 3:41am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/12 "2002-09-11T03:41:12Z")

</div>

Let me know how that goes.

---

<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:** [September 11, 2002, 4:09am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/13 "2002-09-11T04:09:21Z")

</div>

I have now published (only the first link to test it) and when I click the close button I get an error page stating “The page cannot be found” instead of the main web

Would you mind checking it out to see what I mean?  
page.[http://www22.brinkster.com/laranelson/](http://www22.brinkster.com/laranelson/)

---

<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:** [September 11, 2002, 4:17am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/14 "2002-09-11T04:17:23Z")

</div>

Which link on your site do I click on to test 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:** [September 11, 2002, 4:21am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/15 "2002-09-11T04:21:57Z")

</div>

load multiple SWF’s then that will load the html file that contains the swf file. I published it and put it up in html as you suggested.

---

<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:** [September 11, 2002, 4:31am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/16 "2002-09-11T04:31:31Z")

</div>

Ehew, I see what is wrong here. When you copied and pasted my code, for some reason the board put a space between java and script

it is one word…

javascript:close()

…like that

---

<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:** [September 11, 2002, 4:33am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/17 "2002-09-11T04:33:21Z")

</div>

“it’s the little things that make us appreciate life” That is funny, I can’t believe I did not even think of that. I will fix it now. Thank you

---

<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:** [September 11, 2002, 4:35am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/18 "2002-09-11T04:35:17Z")

</div>

Let me know how it goes after you fix it:)

I remember learning Javascript. Even a missing “;” (or an extra one) can make or break your code. It drove me nuts, but I got the hang of it. I love Javascript now:)

---

<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:** [September 11, 2002, 4:55am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/19 "2002-09-11T04:55:43Z")

</div>

do I use \_blank, \_top? in the code to close the window? I have tried this on the movie with the frame action to load all the movie on level one w/ all the buttons, I tried putting a button on the level 0 movies, I tried with it as an html and as an swf. I am totally doing something wrong. Right now it is in an html and the button to close is on level one(the one that loads the movie w/ all the buttons)

[http://www22.brinkster.com/laranelson/](http://www22.brinkster.com/laranelson/)

any Ideas??

---

<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:** [September 11, 2002, 4:59am UTC](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424/20 "2002-09-11T04:59:43Z")

</div>

I would think either \_self or \_top. If it doesn’t create an error, then don’t put anything there at all and try that.

[Next page](https://forum.kirupa.com/t/opening-links-in-presized-windows/5424.md?page=2)
