PDA

View Full Version : close pop-up window with a flash button



pineapple
July 3rd, 2003, 03:16 AM
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:

eyeinfinitude
July 3rd, 2003, 03:20 AM
You can apply this to your flash button, I'm not sure if it would work though.
on(release){
getURL("javascript:close()");
}

pineapple
July 3rd, 2003, 03:25 AM
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!

pineapple
July 3rd, 2003, 03:45 AM
do i also need to put something into the html code to make this work??

fluid_0ne
July 3rd, 2003, 04:13 AM
nope

worm
July 3rd, 2003, 12:29 PM
This doesnt really work effectively cuz it closes the page not the browser window.
Originally posted by electrongeek
[B]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");
}

lbeetles
July 3rd, 2003, 01:44 PM
i think thou when you upload the pages you dont get the alert message that javascript sends.