# Close pop-up window with a flash button

**URL:** <https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657>\
**Category:** Uncategorized\
**Created:** [July 3, 2003, 6:16am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657 "2003-07-03T06:16:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pineapple](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@pineapple](https://forum.kirupa.com/u/pineapple)\
**Post date:** [July 3, 2003, 6:16am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/1 "2003-07-03T06:16:25Z")

</div>

does anyone know if you can close a pop-up window by clicking a button that’s inside the flash swf?

there’s tons of tutorials online regarding how to create pop up windows in flash but nothing on how the user can close the whole window.

besides clicking the “x” on the browser window, is there any other way?

one thousand thank you’s to the one that can answer.

:crazy:

---

<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:** [July 3, 2003, 6:20am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/2 "2003-07-03T06:20:11Z")

</div>

You can apply this to your flash button, I’m not sure if it would work though.

```auto
on(release){
getURL("javascript:close()");
}

```

---

<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:** [July 3, 2003, 6:25am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/3 "2003-07-03T06:25:28Z")

</div>

hi! thanks for the quick reply! i’m going to try the actionscript you posted and i also just ran into this one…

on (release) {  
getURL(“javascript:window.close();”, “\_self”);  
}

i’ll let ya know which one worked!  
cheers!

---

<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:** [July 3, 2003, 6:45am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/4 "2003-07-03T06:45:27Z")

</div>

do i also need to put something into the html code to make this work??

---

<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:** [July 3, 2003, 7:13am UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/5 "2003-07-03T07:13:04Z")

</div>

nope

---

<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:** [July 3, 2003, 3:29pm UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/6 "2003-07-03T15:29:24Z")

</div>

This doesnt really work effectively cuz it closes the page not the browser window.  
Originally posted by electrongeek  
\*\*You can apply this to your flash button, I’m not sure if it would work though.

```auto
on(release){
getURL("javascript:close()");
}

```

but this does. Only I dont like the fact that javascript sends an alert asking u if u want to close. Isnt there a way to bypass this?

```auto
on (release) {
getURL("javascript:window.close();", "_self");
}

```

---

<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:** [July 3, 2003, 4:44pm UTC](https://forum.kirupa.com/t/close-pop-up-window-with-a-flash-button/24657/7 "2003-07-03T16:44:19Z")

</div>

i think thou when you upload the pages you dont get the alert message that javascript sends.
