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

Undefined Property

Guest
Jul 21, 2013 Jul 21, 2013

I am developing an android game.This is an actionscript for exit popup.

I keep getting this error 1120 : Access of undefined property Native Application

CODE :

import flash.events.MouseEvent;

MC1.visible = false;

//Movieclip name declared as MC1

btn_exit.addEventListener(MouseEvent.CLICK, onExit);//Exit Button on menu

function onExit(event:MouseEvent):void

{

          MC1.visible = true;

}

//Function on Button click

MC1.YesBtn.addEventListener(MouseEvent.CLICK, onYes);

function onYes(event:MouseEvent):void

{

   

NativeApplication.nativeApplication.exit();

}

MC1.NoBtn.addEventListener(MouseEvent.CLICK, onNo);

function onNo(event:MouseEvent):void

{

          MC1.visible = false;

}

TOPICS
ActionScript
1.2K
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

correct answers 1 Correct answer

Community Expert , Jul 21, 2013 Jul 21, 2013

check your publish settings.  if you're publishing for android, you should not need to import that class:

import flash.desktop.NativeApplication

and, if you are publishing for a non-air app, you won't be able to import that class.

Translate
Community Expert ,
Jul 21, 2013 Jul 21, 2013

check your publish settings.  if you're publishing for android, you should not need to import that class:

import flash.desktop.NativeApplication

and, if you are publishing for a non-air app, you won't be able to import that class.

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
Jul 22, 2013 Jul 22, 2013

Thanks a lot..it did works.....

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
Community Expert ,
Jul 22, 2013 Jul 22, 2013
LATEST

you're welcome.

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