? for Flash/ actionscript programmers
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
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");
}
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/
getURL ("javascript:window.close()");
}
...get rid of the space in javascript...
Originally posted by johnq
on (release) {
getURL ("javascript:window.close()");
}
...get rid of the space in javascript...
Yeah good point.