2013-07-19 116 views
0

我想从as3中的链接调用swf。我在互联网上搜索,我用这个代码从链接加载外部Swf [As3]

var my_Loader:Loader = new Loader(); 
var my_url:URLRequest=new URLRequest("http://gurselgunacar.web44.net/flash/yalitimhesabi.swf"); 
my_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading); 
my_Loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); 
my_Loader.load(my_url); 
function finishLoading(loadEvent:Event) { 
addChild(loadEvent.currentTarget.content); 
} 
function errorHandler(errorEvent:Event):void { 
trace("file missing"); 
} 

as3通话链接,但我不能做任何事情在瑞士法郎。在输出闪存中出现安全错误。而我尝试crossdomain.xml的东西,它没有工作:S

+0

我认为在Flash环境下本地测试时,你不能像这样从互联网上请求文件。尝试上传您的SWF文件到您的虚拟主机。 –

+0

但我需要.exe格式:S –

回答

2

该文件http://gurselgunacar.web44.net/crossdomain.xml不存在。你应该创建一个。
装载程序将始终在目标服务器上查找crossdomain.xml文件。

+0

ı上传但仍然相同。 <?xml version =“1.0”?> <?xml version =“1.0”?> <!DOCTYPE跨域策略SYSTEM“http://www.adobe.com/xml/dtds/cross-domain -policy.dtd“>

0


Humm。尝试添加这些东西安全:

Security.allowDomain("*"); 
Security.loadPolicyFile("http://gurselgunacar.web44.net/crossdomain.xml"); 

而且在为URLRequest使用:

var my_url:URLRequest=new URLRequest("http://gurselgunacar.web44.net/flash/yalitimhesabi.swf?" + new Date().getTime()); //this will avoid caching old swf. 

我一个EXE投影机上测试,它似乎工作。

+0

安全问题解决了:)但现在输出: TypeError:Error#1009:Boşnesnebaşvuruözelliğineveyayöntemineerişilemiyor。 \t在asdfg_fla :: MainTimeline/frame1() 我也不能在swf中做任何事情。 –