2012-03-06 56 views
1

我正在處理在線繪畫應用程序。儘管crossdomain.xml AS3加載器導致securityError#2044

應用程序SWF以及後端服務器位於: http://217.150.244.137/Client.swf

有位於根以及一個的crossdomain.xml: http://217.150.244.137/crossdomain.xml

我從服務器加載畫布圖像像這樣:

var _loader:Loader = new Loader(); 
//make sure it's really not comming from the cache 
var urlRequest:URLRequest = new URLRequest(url+'?nocache=' + new Date().getTime()); 
var requestHeader1:URLRequestHeader = new URLRequestHeader("pragma", "no-cache"); 
var requestHeader2:URLRequestHeader = new URLRequestHeader("Expires", "Thu, 01 Jan 1970 00:00:00 GMT, -1"); 
var requestHeader3:URLRequestHeader = new URLRequestHeader("Cache-Control", "no-cache, no-store, must-revalidate"); 
urlRequest.requestHeaders.push(requestHeader1); 
urlRequest.requestHeaders.push(requestHeader2); 
urlRequest.requestHeaders.push(requestHeader3); 
var context:LoaderContext = new LoaderContext(true); 

_loader.load(urlRequest, context); 
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); 
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onDataLoaded); 

不過,SWF不會

另一頁embeeded工作時

我得到一個

Error #2044: SecurityErrorEvent unverarbeitet. text=Error #2170: Verletzung der Sicherheits-Sandbox: http://www.pictonauts.theaterspektakel.ch/Client.swf kann keine HTTP-Header an http://217.150.244.137/images/wall/4/img_-2_-1_4.jpg?nocache=1331058396137 senden. 

我缺少什麼或者做錯了嗎?

回答

3

首先,試試這個的crossdomain.xml:

<?xml version="1.0"?>  
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> 
<cross-domain-policy> 
    <site-control permitted-cross-domain-policies="all"/> 
    <allow-access-from domain="*" to-ports="*" secure="false" /> 
    <allow-http-request-headers-from domain="*" headers="*" secure="false" /> 
</cross-domain-policy> 
+0

作品! =)非常感謝! – Mat 2012-03-06 19:06:22

相關問題