ios的空气-声音
早上好,我用AIR为iOS开发了一个简单的音板应用程序,但是声音不起作用。我的意思是,当我打开应用程序时,我可以看到要按下的按钮来播放相关的声音,但当我按下按钮时,声音不会播放 以下是我的AS3:ios的空气-声音,ios,air,for-loop,Ios,Air,For Loop,早上好,我用AIR为iOS开发了一个简单的音板应用程序,但是声音不起作用。我的意思是,当我打开应用程序时,我可以看到要按下的按钮来播放相关的声音,但当我按下按钮时,声音不会播放 以下是我的AS3: import flash.text.TextField; //Array for buttons instances. var buttonsArray:Array = new Array(); buttonsArray[0] = a01; buttonsArray[1] = a02; button
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();
}
导入flash.text.TextField;
//按钮实例的数组。
var buttonsArray:Array=newarray();
按钮阵列[0]=a01;
按钮阵列[1]=a02;
按钮阵列[2]=a03;
//声音剪辑名称的数组。
var soundArray:Array=newarray();
soundArray[0]=“媒体/a01.mp3”;
soundArray[1]=“媒体/a02.mp3”;
soundArray[2]=“媒体/a03.mp3”;
//这将向按钮添加鼠标单击事件。
对于(变量i:uint=0;i
我在“AIR for iOS设置…”中包含了“媒体”文件夹,但仍然不起作用。
怎么了?解决了。我只是将音频剪辑作为.swc包含在内,一切正常