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

Application Exit Issue In IOS

New Here ,
Apr 29, 2013 Apr 29, 2013

How can i exit the application when i pressed the power btton in Iphone , My issue is my app have a music but when i press the power button the app goes into the background as a normal feature of iphone but the app music is not stopping at all , is there any way to acheive it ?

TOPICS
ActionScript
765
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 ,
Apr 29, 2013 Apr 29, 2013

you can check for an exiting event:

NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);

function onExit(e:Event):void{

// stop your sound

}

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
New Here ,
Apr 29, 2013 Apr 29, 2013

Thanks a Lot For reply , is this event works for the power button preess [the Top button of the Iphone] , i was really confufed , my app is going on the background but the music never stoped .

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 ,
Apr 29, 2013 Apr 29, 2013

yes.

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
New Here ,
Apr 30, 2013 Apr 30, 2013

I checked this , but it not solves the issue , since when a mobile is not used for a while or the power button on the top is pressed , the application is not exiting , it goes on the background so the code chunk

NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);

will work when we press the HOME button of the phone , but not the not power button . Do you have any more sugessions

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
New Here ,
Apr 30, 2013 Apr 30, 2013

basically after some research i found what we probably need to do is to set

" Application does not run in background" to No

is theere any way to specify the same in the in .xml files assosiated with the app .

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 ,
Apr 30, 2013 Apr 30, 2013

if the app is going into the background, use:

addEventListener(Event.DEACTIVATE, deactivateF);

function deactivateF(e:Event):void{

//stop sound

}

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
New Here ,
Apr 30, 2013 Apr 30, 2013

Thanks Solved It , I Used A Tag

<key>UIApplicationDoesNotRunInBackground</key><true/>

In the Xml , and itg worked . Thanks a lot for the comments .

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 ,
Apr 30, 2013 Apr 30, 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