0
早上好,我开发了一个AIR for iOS的简单声卡应用程序,但声音不起作用。我的意思是,当我打开应用程序时,我可以看到按钮来播放相对声音,但是当我按下按钮时,声音无法播放。ios的声音 - 声音
这里是我的AS3:
import flash.text.TextField;
//Array for buttons instances.
var buttonsArray:Array = new Array();
buttonsArray[0] = a01;
buttonsArray[1] = a02;
buttonsArray[2] = a03;
//Array for the sound clip names.
var soundArray:Array = new Array();
soundArray[0] = 'media/a01.mp3';
soundArray[1] = 'media/a02.mp3';
soundArray[2] = 'media/a03.mp3';
//This adds the mouse click event to the buttons.
for(var i:uint = 0; i < buttonsArray.length; i++){
buttonsArray[i].addEventListener(MouseEvent.CLICK, buttonClicked);
}
astop.addEventListener(MouseEvent.CLICK, stopButtonClicked);
//This function stops any sound clip that is playing and
//plays the sound file thats clicked.
function buttonClicked(e:MouseEvent):void{
SoundMixer.stopAll();
for(var i:uint = 0; i < buttonsArray.length; i++){
if(e.target == buttonsArray[i]){
var s:Sound = new Sound();
s.load(new URLRequest(soundArray[i]));
s.play();
}
}
}
//This function adds a stop button
function stopButtonClicked(e:MouseEvent):void{
SoundMixer.stopAll();
}
我列入 “媒体” 文件夹 “AIR为iOS设置...”,但仍然无法正常工作。 它有什么问题?