运行时声音与 Flash 9 上的 ActionScript 3 重叠
AS3、Flash 播放器 9 出现问题:使用以下代码时。
加载新的 SWF 后,我无法停止播放已卸载的 swf 上的声音?
我尝试在所有 swf 的打开框架的操作面板上放置混音器停止所有代码。我的主 swf 中有这段代码,声音位于加载的 swf 中。
我正在使用 Flash 播放器 9、AS3、Flash CS5
var Xpos:Number = 53;
var Ypos:Number = 17;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/Animation1.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest =
new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
}
// Btn listeners
ActivatePart1.addEventListener(MouseEvent.CLICK, btnClick);
ActivatePart2.addEventListener(MouseEvent.CLICK, btnClick);
ActivatePart3.addEventListener(MouseEvent.CLICK, btnClick);
Certificates.addEventListener(MouseEvent.CLICK, btnClick);
Having a problem with AS3, Flash player 9: When using the following code.
I cant stop the sounds on the unloaded swf from playing back after a new SWF is loaded??
I've tried putting a sound mixer stop all code on the actions panel of the opening frame for all my swf's. I have this code in my main swf, the sounds are in the loaded swf's.
I'm using Flash player 9, AS3, Flash CS5
var Xpos:Number = 53;
var Ypos:Number = 17;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/Animation1.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest =
new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
}
// Btn listeners
ActivatePart1.addEventListener(MouseEvent.CLICK, btnClick);
ActivatePart2.addEventListener(MouseEvent.CLICK, btnClick);
ActivatePart3.addEventListener(MouseEvent.CLICK, btnClick);
Certificates.addEventListener(MouseEvent.CLICK, btnClick);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
Loader
中加载新的 swf 之前,您是否调用Loader.unloadAndStop()
?Do you call
Loader.unloadAndStop()
before loading a new swf in yourLoader
?