xml, and i want to get data from external file xml in remote server using AS3, My problem is data xml is showing in consol (trace (data)) but not showing in swf file. if the swf and xml are in the same domain there is no problem.
my crossdomain
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM "http://ift.tt/1d1B8yI">
<cross-domain-policy>
<allow-access-from domain="*" />
<site-control permitted-cross-domain-policies="by-content-type"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
and my code as3.
`
import flash.text.TextField;
import flash.system.Security;
//var p:TextField = new TextField();
//Security.allowDomain("my.domain.com");
Security.loadPolicyFile("http://ift.tt/1s7VMVl");
var myXML:XML = new XML();
var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, processXML);
myLoader.load(new URLRequest("http://ift.tt/1qtqHbR"+Math.random()*28));
function processXML(e:Event):void {
myXML = XML(e.target.data);
p.text=myXML.IMAGE[1].@TITLE;
//trace(p);
//addChild(p);
for (var i:int = 0; i<myXML.*.length(); i++){
trace("My image number is " + (i+1) + ", it's title is " + myXML.IMAGE[i].@TITLE + " and it's URL is " + myXML.IMAGE[i]);
trace("----------------"+myXML.IMAGE[i].@TITLE);
};
}`
No comments:
Post a Comment