在 as2 中动态加载声音有问题
我想加载声音文件夹中的声音。 代码是
var my_sound = new Sound();
my_sound.loadSound("sounds/sound1.mp3");
my_sound.onLoad = function(success:boolean){
if(success){
my_sound.start();
}
}
当闪光灯打开并按 CTRL+ENTER(测试影片)时,它会播放声音。
但是当我们播放swf时,它不会播放声音。
对于这个问题我找到了一个解决方案。
我关闭了onLoad函数。 和测试电影。 现在发生了相反的事情。
按 CTRL+ENTER (TestMovie) 时不播放;
但它在播放 swf 时播放。
还有其他加载声音的方法吗?
I want to load sound placed in sounds folder.
Code is
var my_sound = new Sound();
my_sound.loadSound("sounds/sound1.mp3");
my_sound.onLoad = function(success:boolean){
if(success){
my_sound.start();
}
}
This plays sound when flash is open and pressing CTRL+ENTER(Test Movie).
but when we plays the swf it won't play sound.
for this problem i found one solution.
i made off onLoad function. and the Test Movie. Now the opposite things happend.
It dosen't play when press CTRL+ENTER (TestMovie);
but it plays when swf is playing.
Is there any other way of loading sound.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
这将在加载后立即停止声音。
每当你想启动声音时,只需调用此函数:
Try:
This will stop the sound as soon as it's loaded.
Whenever you want to start the sound, just call this function: