Close pop-up window with a flash button

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:

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

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

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!

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

nope

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.

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?

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

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