需要创建crossdomain.xml
<?xml version="1.0"?>
<!-- http://phpv1.ssvlog.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
否则无法进行访问。并且在ie中报错。 沙盒保护。
this.myXML4 = new XML();
this.XML_URL4 ="http://fff.com/yz.php";
this.myXMLURL4 = new URLRequest(this.XML_URL4);
this.myLoader4 = new URLLoader(this.myXMLURL4);
this.myLoader4.addEventListener(Event.COMPLETE, this.xmlLoaded4);
this.myLoader4.addEventListener(IOErrorEvent.IO_ERROR, this.xmlLoaderr4);
如果访问不了 则不会进入监听。也就无法执行。这块注意下
public function xmlLoaded4(_arg1:Event)
{
this.myXML = XML(this.myLoader4.data);
this.err = this.myXML.err;
this.msg = this.myXML.msg;
if (this.err == "yes")
{
Alert.init(stage);
Alert.show(this.msg);
}else{
}
}
public function xmlLoaderr4(_arg1:Event)
{
}