I want to know why I can't use this code
I know the problem isPHP Code:
var xml:XML = new XML();
var loader:URLLoader = new URLLoader();
function xmlloaded(e:Event):void {
xml=e.target.data as XML;
trace(xml.toString());
}
loader.load(new URLRequest('photogallery.xml'));
loader.addEventListener(Event.COMPLETE,xmlloaded);
but I want to know why I can't use the as XML instead of XML(e.target.data)?Code:xml=e.target.data as XML;
thank you