简体   繁体   中英

Flash XML error

I'm using the following code to get something through XML

var myLoader:URLLoader;
var myXML:XML;
var myXMLURL:URLRequest = new URLRequest("http://testapp.varheroes.com/yofacebook/canvas/calcammo/");

myXMLURL.method = URLRequestMethod.POST;
myLoader= new URLLoader(myXMLURL);
myLoader.dataFormat=URLLoaderDataFormat.TEXT;
myLoader.addEventListener(Event.COMPLETE, processXML);


function processXML(e:Event):void {
    myXML = new XML(e.target.data);
    dummyText.text = myXML.AMMO;
}

When I test the code offline it works perfectly fine but when I put it on the webpage

http://media.varheroes.com/flash/as3.swf

It stops working :/

Running it offline gives me this XML, which I can put in a text field

<MAIN><AMMO>54564564564564564545464564564564</AMMO></MAIN>

如果您的xml文件不在应用程序中,请查找跨域xml。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM