Skip to main content
Participant
July 2, 2008
Question

Closing a Main Browser Window

  • July 2, 2008
  • 1 reply
  • 277 views
I'm loading (onload) .swf files into an html shell. The shell holds my Flash exported SWF file, which is embedded in the html file, so, I have buttons on the top of the html page for resources, etc. I also have a link to EXIT. I'm trying to figure out how to close this main browser window using a button action. Is this close:

Header of HTML shell

<head>


<script language="javascript">
<function closewindow()

if(window.parent!=window){
window.close = function() { window.parent.close(); }}

</SCRIPT>


</head>


---------

BUTTON in Flash:

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


This topic has been closed for replies.

1 reply

Participant
July 2, 2008
Sorry, figured it out.

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