I am trying to stop the audio of the video swf and I can't get it to stop. Here is my code for loading the file:
我试图阻止视频swf的音频,我不能让它停止。这是我加载文件的代码:
var myLoader:Loader= new Loader();
myLoader.x=420;
myLoader.y=200;
// boolean variable set for use below in our function
var screenCheck:Boolean = false;
//These three linces keep stafe elements the same size, so they don't distort
var swfStage:Stage = this.stage;
video_btn.addEventListener(MouseEvent.CLICK,contentvideo);
function contentvideo (event:MouseEvent):void{
myLoader.load(new URLRequest("prevideo.swf"));
addChild(myLoader);
movie_btn.stop();
movie_btn.visible=false;
}
Now I have other functions that load different URLRequest and when they are loading, the audio keeps playing. Do I have to add a line of code to them? I also have an MP3 player and tried SoundMixer.stopAll()
. I still need the mp3 player to keep playing.
现在我有其他功能加载不同的URLRequest,当它们加载时,音频继续播放。我必须向他们添加一行代码吗?我也有一个MP3播放器,并尝试了SoundMixer.stopAll()。我仍然需要MP3播放器继续播放。
1 个解决方案
#1
0
I'm not familiar with what you're doing but just looking at the code and given the problem you're experiencing I wonder if that
我不熟悉你在做什么,只是看着代码并给出你遇到的问题我想知道是不是
addChild(myLoader);
has anything to do with it. It seems like the kind of thing that could easily create multiple child objects which is why you continue to experience the sound play back. Is there a removeChild[0]
option or something?
与它有任何关系。看起来像是可以轻松创建多个子对象的东西,这就是为什么你继续体验声音播放的原因。是否有removeChild [0]选项或什么?
A shot in the dark I know but I thought I'd offer the possibility anyway.
在黑暗中拍摄我知道,但我想我无论如何都会提供这种可能性。
#1
0
I'm not familiar with what you're doing but just looking at the code and given the problem you're experiencing I wonder if that
我不熟悉你在做什么,只是看着代码并给出你遇到的问题我想知道是不是
addChild(myLoader);
has anything to do with it. It seems like the kind of thing that could easily create multiple child objects which is why you continue to experience the sound play back. Is there a removeChild[0]
option or something?
与它有任何关系。看起来像是可以轻松创建多个子对象的东西,这就是为什么你继续体验声音播放的原因。是否有removeChild [0]选项或什么?
A shot in the dark I know but I thought I'd offer the possibility anyway.
在黑暗中拍摄我知道,但我想我无论如何都会提供这种可能性。