我有一个使用SoundMixer控制音量的较大文件加载的AS3预加载电影。当两个文件位于同一台服务器上时,一切都可以在本地和在线上运行。Flash AS3 SoundMixer沙盒违规?
然而,当我分割文件时,假设有一个服务器上的加载程序swf和另一个上的较大内容,当我单击音量按钮时出现此错误。 (这个错误其实输出,而测试的加载程序SWF文件,加载从在线服务器的内容。)
*安全沙箱冲突* 的SecurityDomain“http://www.onlinedomain.com/content.swf”试图访问不兼容的上下文'文件:///LocalDisc/WORK//loader.swf'
SecurityError:错误#2070:安全沙箱冲突:调用者http://www.onlinedomain.com/content.swf无法访问由file:/// LocalDisc/WORK // loader加载的阶段瑞士法郎。 在flash.media::SoundMixer$/set的SoundTransform() 在content_fla :: MainTimeline/stopSound() 在content_fla :: MainTimeline/soundMenuHandler()
我已经加入的crossdomain.xml文件,以两个服务器允许访问。
该处理的声音在我的content.swf的功能是:
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
function soundMenuHandler(event:MouseEvent):void {
if (sound == "ON") {
sound_btn.gotoAndStop(3);
stopSound();
} else {
sound_btn.gotoAndStop(1);
playSound();
}
}
function playSound():void {
sound = "ON";
SoundMixer.soundTransform = new SoundTransform(1);
}
function stopSound():void
{
sound = "OFF";
SoundMixer.soundTransform = new SoundTransform(0);
}
The issue seems to be because of the SoundMixer accessing the loader.swf. Has anyone any idea what is going on and how this can be resolved?
Many thanks,
Mark
感谢您的回复。是的,我仅在本地进行测试才能看到Flash IDE中的输出跟踪。 – crooksy88 2011-03-11 15:44:14
我只是这样做才能看到Flash IDE中的错误输出。问题是,当我在线运行文件时,每个文件都来自不同的服务器,内容文件确实会加载但立即停止工作,因为调用了startSound函数并发生了安全违规。 – crooksy88 2011-03-11 16:21:18
有一个链接,我可以看到发生的错误,并看看crossdomains.xml? – 2011-03-12 14:14:15