Click to See Complete Forum and Search --> : closing window from the Flash


Ambrrose
05-09-2003, 09:11 AM
How can I close the browser's window from the Flash movie?

thanks

FrequeNC
05-26-2003, 08:02 PM
You can close the browsers window that holds the flash movie simply by - on your button event in flash (or on the timeline) apply this action.

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

You do not need to have a <script> tag in your html file, that line of javascript works by itself because it is a predefined event handler in javascript. If you wanted to close the window from a certain point based off of the timeline rather than a button, you would just obviously not need the on(release) event.

KendyChen
06-07-2003, 03:23 AM
agree

cathy_ysh
12-21-2005, 03:09 AM
I had tried this script, on my flash movie (in a browser window) and wanted to close the window itself, I failed to get the browser window to close. Why is it so? :confused:

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

tele159
12-21-2005, 08:21 AM
it doesn't work for me either. :confused:

ccoppenbarger
12-23-2005, 11:53 AM
Try window.close()
or write a script.js file, linked to in your html file which contains the
function close_window(){
window.close();
}
In Flash call getURL('close_window());

Chris Coppenbarger
http://www50.brinkster.com/cjcomm
http://cjcomm.blogspot.com