AS3 | SWF负荷问题 [英] AS3 | SWF load issue

查看:127
本文介绍了AS3 | SWF负荷问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我我的项目导出为SWF文件,它不会加载从URL地址和放大器的XML文件;图像从URL。我试图将其导出为一个EXE文件和它的作品。使用Ctrl + Enter键在Adobe Flash中它也能工作。如何解决这个问题?

解决方案
  1. 在调试模式下,跨域安全检查被禁止(这就是为什么你被允许这样做,使用CTRL + ENTER)
  2. 的EXE你已经在differrent情况下,它允许您从任何URL加载文件,因为你的EXE就在你dekstop运行。

要解决这个问题,你需要在下列情况之一:

a)您在同一个域中的SWF加载来自URL的数据,

例如:您的SWF是mysite.com/myflash.swf和加载XML从mysite.com/somefile.xml

b)你从differrent域加载数据,在这种情况下,你需要在域的根URL跨domain.xml文件你来自哪里

加载XML的

例如:你现在从someothersite.com/somefile.xml加载XML

有关跨的domain.xml和安全策略,你C和查找谷歌..更多细节

<一个href="http://stackoverflow.com/questions/213251/can-someone-post-a-well-formed-crossdomain-xml-sample">Can有人张贴以及形成的crossdomain.xml样?

http://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html

When I export my project as a swf file it won't load the XML file from the url address & images from the url. I'm trying to export it as an exe file and it works. With Ctrl+Enter in Adobe Flash it works too. How to fix it?

解决方案

  1. In debug mode, cross domain security checks are disabled (this is why you are allowed to do that with ctrl+enter)
  2. As exe you are already in a differrent context which allows you to load files from any url since your exe is running on your dekstop.

To fix the issue, you need to be in one of the following cases:

a) you load data from url's in the same domain as your swf,

ex: your swf is at mysite.com/myflash.swf and loads an xml from mysite.com/somefile.xml

b) you load data from a differrent domains, in this case you need a cross-domain.xml file in the root url of the domains where you load the xml's from

ex: you now load an xml from someothersite.com/somefile.xml

More details about cross-domain.xml and security policies you cand find by google..

Can someone post a well formed crossdomain.xml sample?

http://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html

这篇关于AS3 | SWF负荷问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆