I want to know why I can't use this code
PHP 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); 
I know the problem is
Code:
xml=e.target.data as XML;
but I want to know why I can't use the as XML instead of XML(e.target.data)?

thank you