我强烈同意brd6644。你需要一个跨域策略文件服务器上的配置文件驻留的地方。复制下面的XML文件名为“crossdomain。xml”并把它放在服务器的根服务器,其中包含您的配置文件。
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
你可能不需要这个如果swf驻留在同一台服务器上的配置文件。也,如您所见,这个跨域策略允许访问所有领域,所以,如果你非常关心安全(可能不是重要的学校项目),读了些关于他们如何配置。这是一个很好的< a href = " http://labs.adobe.com/wiki/index.php/Flex Accessing_Data # Using_crossdomain.xml_files”rel = " nofollow noreferrer " > < / >的文章
同时,这里有一些样本HTTPService代码:因为
private function init():void{
get_bands_service.url = yeswewillArtistsURL;
get_bands_service.method = "GET";
get_bands_service.addEventListener(FaultEvent.FAULT, onServiceFault);
get_bands_service.requestTimeout = 20;
get_bands_service.send();
}
<mx:HTTPService id="get_bands_service" result="parseBandsServiceResult();" useProxy="false" />