我正在尝试从数组中播放随机声音。这是我正在使用的代码。有任何想法吗?这是行不通的。
import flash.media.Sound;
//var mySound:Sound = new Sound();
var mySoundsArray:Array = ["blue.mp3","green.mp3","red.mp3","yellow.mp3"];
var storedSounds:Array;
for(var i =0; i < mySoundsArray.length; i++)
{
/// DOES NOT WORK BELOW
storedSounds[i] = new Sound();
storedSounds[i].load(new URLRequest("sounds/" + mySoundsArray[i]));
}
/// later to loop through sounds but for now I use the line below default at 0
mySoundsArray[0].play();