A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Closing the browser window

  1. #1
    Senior Member em_city's Avatar
    Join Date
    Jul 2002
    Posts
    202
    How can I have a flash button close the browser window?

    I created a flash cd rom with an exit button. Now the client is using this on their intranet site and the fscommand("quit") function no longer works. So I want to change the actionscript to close the browser window.

    Couldn't they create an invisible button in html or javascript that lies over the flash file that closes their browser window?


    Any suggestions?

    Thanks

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Posts
    191
    1. write a function in javascript which says

    function closeWin(){
    window.close();
    }

    2. call this function through flash on a click of a button using the getURL method.



  3. #3
    Senior Member em_city's Avatar
    Join Date
    Jul 2002
    Posts
    202
    Thanks Sid I'll give it a try.

  4. #4
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    You actually don't need a function predefined, use this:

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

  5. #5
    Senior Member
    Join Date
    Aug 2002
    Posts
    191
    that something new to me, estudioworks.

    em_city, when one close's a parent window using this command "window.close()" a confirmation message box is displayed. To avoid it you will have to call "window.close" command on a child window instead of the parent window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center