我正在使用此代码:
if (Capabilities.cpuArchitecture=="ARM") {
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleActivate, false, 0, true);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE , handleDeactivate, false, 0, true);
}
function handleActivate(event:Event):void {
var transformGlobal1:SoundTransform=new SoundTransform();
transformGlobal1.volume=1;
flash.media.SoundMixer.soundTransform=transformGlobal1;
NativeApplication.nativeApplication.systemIdleMode=SystemIdleMode.KEEP_AWAKE;
}
function handleDeactivate(event:Event):void {
var transformGlobal2:SoundTransform=new SoundTransform();
transformGlobal2.volume=0;
flash.media.SoundMixer.soundTransform=transformGlobal2;
}
在来电时将我的音乐应用的音乐静音。但是当您按下手机的关闭或菜单按钮时也会触发。有没有办法让关闭按钮和菜单按钮做自己正常的事情?虽然这个代码只影响来电?