我有两个错误: #2044:未处理的 IOErrorEvent:。 text=错误 #2032:流错误。
我测试了几次,音乐播放器场景同时出现了未处理的 IOErrorEvent 和流错误。我发现这个视频如何使用actionscript 3.0创建一个简单的MP3播放器, 任何人都可以修复这些错误吗?
var myMusic:Sound = new Sound();
var musicChannel: SoundChannel = new SoundChannel();
var musicIndex: Number = 0;
var music: Array = new Array();
var pp: Boolean = true;
music = ['Aqua Man- Guitar Remix', 'Summer Treasure Hunt Event 1', 'Summer Treasure Hunt Event 2',
'Sizzling Heat! Splendid Summer Event', 'Brick Dive', 'Bloocheep Ocean','Dire Dire Docks Remix - Calm Waters',
'Dire Dire Docks Remix - Calm Waters', 'Mario Teaches Typing 2 (1996) - Underwater', 'Treasure Cove! Level 1',
'Treasure Cove! Level 2', 'Treasure Cove! Level 3', 'Under Pressure'];
myMusic.load(new URLRequest("E:/Flash Animations/Folder 1/Games/Bit-Bot Math Voyage/Music"+[musicIndex]));
看起来您的数组访问方法有错误:
myMusic.load(
new URLRequest(
"E:/Flash Animations/Folder 1/Games/Bit-Bot Math Voyage/Music" +
[musicIndex] // This creates a new array with one integer element
));
我想你想要:
myMusic.load(
new URLRequest(
"E:/Flash Animations/Folder 1/Games/Bit-Bot Math Voyage/Music" +
music[musicIndex] // This returns the musicIndex element from the music array
));
您可能还想在
/
的末尾添加 Music
?
myMusic.load(
new URLRequest(
"E:/Flash Animations/Folder 1/Games/Bit-Bot Math Voyage/Music/" +
music[musicIndex] // This returns the musicIndex element from the music array
));