? for Flash/ actionscript programmers

Posted:
in Mac Software edited January 2014
I'm currently taking a class in action script. My question is, how can I make my flash program close when I click the "off" button? What code should I stick in that their button. I've searched through the help system with various combinations of off, exit, close, quit, etc. to no avail. Can anyone help?

Comments

  • Reply 1 of 5
    deestardeestar Posts: 105member
    Quote:

    Originally posted by Guartho

    I'm currently taking a class in action script. My question is, how can I make my flash program close when I click the "off" button? What code should I stick in that their button. I've searched through the help system with various combinations of off, exit, close, quit, etc. to no avail. Can anyone help?



    It should be in the FSCommands section of the actions library, here is the code either way:



    on (release) {

    fscommand("quit");

    }
  • Reply 2 of 5
    guarthoguartho Posts: 1,208member
    Thanks for taking the time to help me. I actually tried that earlier. I guess I must have left out a ) or a ; or something. It works as a stand-alone flash now. I don't suppose you know a way to make it close a browser window that it's being run in?
  • Reply 3 of 5
    deestardeestar Posts: 105member
    Quote:

    Originally posted by Guartho

    Thanks for taking the time to help me. I actually tried that earlier. I guess I must have left out a ) or a ; or something. It works as a stand-alone flash now. I don't suppose you know a way to make it close a browser window that it's being run in?



    Yeah sure no problem, the code you need for a browser window is:



    on (release) {

    getURL ("javascript:window.close()");

    }



    Enjoy



    This seems to be a good site for Flash action scripts, may come in handy in the future.



    http://www.actionscript.org/actionscripts_library/
  • Reply 4 of 5
    johnqjohnq Posts: 2,763member
    on (release) {

    getURL ("javascript:window.close()");

    }



    ...get rid of the space in javascript...
  • Reply 5 of 5
    deestardeestar Posts: 105member
    Quote:

    Originally posted by johnq

    on (release) {

    getURL ("javascript:window.close()");

    }



    ...get rid of the space in javascript...




    Yeah good point.
Sign In or Register to comment.