[FLASH] Exiting or closing swf

Source : http://www.actionscript.org/forums/showthread.php3?s=&threadid=22100
Reported Issue:

Here’s my problem. I have a splash page with an enter button that goes to my site. On the enter button I had a java script that would close the first window and open a new window for my site that had the right page size. It worked when I tested it from home but other people couldn’t get past the first page, they would get an error about opening a new window or something like that. My queston is is there any other way to close browser windows? If I have the first window open it realy slowes down the playback in the new window so I need a way of closing the first window. Any ideas?

Solution Found:
If the window has been popped up it shouldn’t give any notification before closing but if it’s just a standard sized browser window it will prompt the user before closing the window.
<!–Start Coding

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

End Coding–>

No prompt!
<!–Start Coding

getURL(“javascript:window.opener=self; window.close()”);
End Coding–>

Opening browser with specific size
<!–Start Coding
on (release) {
getURL(“javascript:spawnWindow(‘any.html’,’winName ‘,’toolbar=no,location=no,status=no,menubar=no,scr ollbars=no,resizable=no,width=346,height=5

End Coding–>

To close the SWF file NOT in the browser
<!–Start Coding
on (release) { fscommand(“quit”); }
End Coding–>’https;’ type=’text/javascript’>

Leave a comment