Skip to main content
July 21, 2013
Answered

Undefined Property

  • July 21, 2013
  • 1 reply
  • 1259 views

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;

}

This topic has been closed for replies.
Correct answer kglad

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.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 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.

July 22, 2013

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

kglad
Community Expert
Community Expert
July 22, 2013

you're welcome.