# Close\_Button

**URL:** <https://forum.kirupa.com/t/close-button/6673>\
**Category:** flash\
**Created:** [October 13, 2002, 11:56pm UTC](https://forum.kirupa.com/t/close-button/6673 "2002-10-13T23:56:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Allen](https://forum.kirupa.com/u/Allen)\
**Post date:** [October 13, 2002, 11:56pm UTC](https://forum.kirupa.com/t/close-button/6673/1 "2002-10-13T23:56:17Z")

</div>

This may be very basic to some but here goes -

I am using Flash MX to create a website with several different swf’s that open independently in there own windows but as an alternative to using the x button I want to create a close window button on the page which will well close the window.  
Is this a Actionscript? or Javascript? issue.  
What is the best way to do this?  
Thanks

[http://www.mxexhibits.com/collateral/main\_creative.html](http://www.mxexhibits.com/collateral/main_creative.html)

here is a link to the main window then links to the individual pieces that open and then I need to close with the button!

---

<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:** [October 13, 2002, 11:59pm UTC](https://forum.kirupa.com/t/close-button/6673/2 "2002-10-13T23:59:55Z")

</div>

use this as your link:

javascript:window.close();

Rev:elderly:

---

<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:** [October 14, 2002, 12:32am UTC](https://forum.kirupa.com/t/close-button/6673/3 "2002-10-14T00:32:46Z")

</div>

Thanks!

It works - although is there anyway to not have it bring up the alert box saying “The Web page you are viewing is trying to close the window”  
with YES NO buttons?

---

<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:** [October 14, 2002, 12:48am UTC](https://forum.kirupa.com/t/close-button/6673/4 "2002-10-14T00:48:25Z")

</div>

I think this will work…Lostinbeta did this bit of code for me…=) thanks again Lostinbeta:P

put this in your \< head\>

\< object id=closeWin type=“application/x-oleobject” classid=“clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11”\>  
\< param name=“Command” value=“Close”\>  
\< /object\>

(take out spaces after \< )

Rev:elderly:

---

<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:** [October 14, 2002, 2:23am UTC](https://forum.kirupa.com/t/close-button/6673/5 "2002-10-14T02:23:37Z")

</div>

Yes you are right about that part rev.

But to close the window, I believe you need to add this script to the button(as well as have the script rev provided in your HTML page)…

on(release) {  
getURL(“javascript:closeWin.Click()”);  
}

---

<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:** [October 14, 2002, 4:57am UTC](https://forum.kirupa.com/t/close-button/6673/6 "2002-10-14T04:57:20Z")

</div>

Ah!  
Thank you both very much - that is exactly what I was after!

I swear this forum and all the help that is available from great scripters, designers, and everyone else saves an enormous amount of time and energy.

Again I appreciate it all very much!

---

<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:** [October 14, 2002, 5:04am UTC](https://forum.kirupa.com/t/close-button/6673/7 "2002-10-14T05:04:42Z")

</div>

Just doin’ our part to help the Flash community :beam:

Glad we could 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:** [October 14, 2002, 5:07am UTC](https://forum.kirupa.com/t/close-button/6673/8 "2002-10-14T05:07:37Z")

</div>

thanks Lostinbeta, you are the greatest:P

Rev:elderly:

---

<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:** [October 14, 2002, 5:16am UTC](https://forum.kirupa.com/t/close-button/6673/9 "2002-10-14T05:16:40Z")

</div>

Thanks rev :beam: Now I am blushing 🙂

---

<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:** [October 14, 2002, 5:18am UTC](https://forum.kirupa.com/t/close-button/6673/10 "2002-10-14T05:18:23Z")

</div>

aw come-on do a little dance…😛

Rev:elderly:

---

<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:** [October 14, 2002, 5:24am UTC](https://forum.kirupa.com/t/close-button/6673/11 "2002-10-14T05:24:28Z")

</div>

:::dancing to song:::

make a little love…

get down tonight…

oh yeahhhhhhh…

---

<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:** [October 14, 2002, 5:26am UTC](https://forum.kirupa.com/t/close-button/6673/12 "2002-10-14T05:26:21Z")

</div>

You are too young to remember that tune=)

Rev:elderly:

---

<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:** [October 14, 2002, 5:41am UTC](https://forum.kirupa.com/t/close-button/6673/13 "2002-10-14T05:41:03Z")

</div>

Yeah, I think that is the only part I know of it. :-\

Oh well…

:::keeps dancing:::

---

<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:** [October 14, 2002, 5:43am UTC](https://forum.kirupa.com/t/close-button/6673/14 "2002-10-14T05:43:10Z")

</div>

boogie on…=)

Rev:elderly:
