I have begun testing on my Android device and have run into an issue with stopping the sound when user exits the application.

My goal is to stop the sound in the application when the following occurs on the Android phone:

1) The user presses the "Home" button on the phone.
2) The user presses the "Back" button on the phone.
3) The user presses the "Search" button on the phone.
4) The user exits the application through a phone call or other event.

I have started the code and I know what I want to happen when the above conditions are met but do not know how to complete it or I don't know how to trigger the events considering when the user taps an item on the phone:

Actionscript Code:
//Exiting the application

function ExitApp(event:MouseEvent):void
{
    SoundMixer.stopAll();
    NativeApplication.nativeApplication.exit(0);
}

Also, what does this symbol "||" mean in an if/then statement?