Flex组件中的Google Maps
时间:2020-03-05 18:52:33 来源:igfitidea点击:
我将Google Maps Flash API嵌入Flex中,并且在本地运行良好并带有水印,等等。将其上传到服务器(flex.mydomain.com)时,出现以下沙箱安全性错误:
SecurityError: Error #2121: Security sandbox violation: Loader.content: http://mydomain.com/main.swf?Fri, 12 Sep 2008 21:46:03 UTC cannot access http://maps.googleapis.com/maps/lib/map_1_6.swf. This may be worked around by calling Security.allowDomain. at flash.display::Loader/get content() at com.google.maps::ClientBootstrap/createFactory() at com.google.maps::ClientBootstrap/executeNextFrameCalls()
有没有人有将Google Maps Flash API嵌入Flex组件并专门设置安全性设置以使其工作的经验?我确实获得了一个新的API密钥,该密钥已注册到我的域,并且在发布时正在使用它。
我已经尝试在主应用程序以及该组件中执行以下操作:
Security.allowDomain('*') Security.allowDomain('maps.googleapis.com') Security.allowDomain('mydomain.com')
解决方案
回答
这听起来像是一个与" crossdomain.xml"相关的问题。我进行了快速搜索,似乎有很多人遇到同样的问题。通过XMLHttpRequest等的一些代理请求。
问题406:为Google帐户添加crossdomain.xml
回答
谢谢帮助。显然,这与在ASP.NET页上包含Flex应用程序有关。当我将其移到平面HTML文件时,它可以正常工作。我现在没有时间充分调查,但这似乎已经解决了。