Copy link to clipboard
Copied
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;
}
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks a lot..it did works.....
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now