Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS3 button

Guest
Mar 19, 2015 Mar 19, 2015

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?

TOPICS
ActionScript
298
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 19, 2015 Mar 19, 2015

Did you include:

import flash.system.fscommand;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 19, 2015 Mar 19, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2015 Mar 20, 2015
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines