1 Reply Latest reply on Feb 19, 2009 5:35 AM by robdillon

    Exit Button not working

    Night_Watch
      ok so I have a button symbol called button2 ( I know, very catchy ) and I have this code set for it-

      button2.onRelease = function() {
      fscommand("quit");
      };

      When I check for errors it says there are none but when I click the button in the SWF, it doesn't close the window. Any ideas?
        • 1. Re: Exit Button not working
          robdillon Most Valuable Participant
          The quit command will close a projector window, but not an swf. The swf is, or should be, playing inside a browser window. The quit command has no effect on the browser. If you want to close a browser window, you'll have to use javascript. Most browsers will not respond positively to a window.close() command in javascript unless that window was opened using javascript.

          So, if you have used window.open() to spawn the window that holds your swf, then you can use:

          button2.onRelease = function() {
          getURL("javascript:window.close();");
          }

          to close that same browser window.