提问人:Isaac Yeap Jie Ling 提问时间:11/13/2023 更新时间:11/13/2023 访问量:29
2 简单音乐播放器的错误问题
2 error problems for simple music players
问:
我有 2 个错误: #2044:未处理的 IOErrorEvent:。text=Error #2032:流错误。
我测试了几次,我同时对音乐播放器场景进行了未处理的 IOErrorEvent 和 Stream Error。我找到了这个视频如何使用 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]));
答:
0赞
Michael
11/13/2023
#1
看起来您的数组访问方法有错误:
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
));
评论
0赞
Isaac Yeap Jie Ling
11/13/2023
我已经设法解决了这个问题。但是我需要音乐名称而不看到“.mp3”
下一个:AS3 中的不同场景、不同帧率
评论