Copy link to clipboard
Copied
I am trying to write a button that will close the application down upon click. My code is as follows:
Exit_mc.addEventListener(MouseEvent.CLICK, CloseApp);
function CloseApp(e:MouseEvent) {
fscommand("quit");
}
The application runs with no errors but when I click on the button nothing happens. Can anybody help?
Copy link to clipboard
Copied
Did you include:
import flash.system.fscommand;
Copy link to clipboard
Copied
Oh sorry must not have pasted that part in, yeah I included that into my code, when the app has finished running it goes to the end screen where the user can click the button to exit. So far no luck with it
Copy link to clipboard
Copied
Here's an extensive discussion of closing an app. actionscript 3 - How to create exit button in Flash application - Stack Overflow One of these suggestions should work for you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now