lundi 30 janvier 2017

ActionScripts3 read XML from Server issue

I have a sample XML on LocalHost and I wrote some code to read it's data, it works fine but when i uploaded to Byethost server it works on web-browser but return error in Adobe Animate.

XML Sample:

<?xml version="1.0" encoding="UTF-8"?>
<Data>

    <D1>1</D1>
    <D2>2</D2>
    <D3>3</D3>

</Data>

AS3 Codes:

import flash.events.Event; 
import flash.net.URLLoader; 

var myXML:XML = new XML(); 
var XML_URL:String = "http://ift.tt/2kKJW48"; 
var myXMLURL:URLRequest = new URLRequest(XML_URL); 
var myLoader:URLLoader = new URLLoader(myXMLURL); 
myLoader.addEventListener(Event.COMPLETE, xmlLoaded); 

function xmlLoaded(event:Event):void 
{ 
    myXML = XML(myLoader.data); 
    trace(myXML.D1); 
    trace(myXML.D2); 
    trace(myXML.D3); 

}

Output when reading XML in localhost from ActionScripts3:

1 2 3

Output when using Web-Browser:

1 2 3

Output when reading XML in server (byet.host) from ActionScripts3:

TypeError: Error #1085: The element type "d.length;f++)e+=(16" must be terminated by the matching end-tag "</d.length;f++)e+=(16>".

Aucun commentaire:

Enregistrer un commentaire