var xml:XML =
<xml>
<ui idx = "0">
<item idx ="0"><key/></item>
<item idx ="1"><key/></item>
<item idx ="2"><key/></item>
</ui>
<ui idx = "1">
<item idx ="0"></item>
</ui>
</xml>;
var xml1:XML =<example><two>2</two></example>;
trace(xml is XML); //true
trace(xml is XMLList); //false
trace(xml.ui is XML); //false
trace(xml.ui is XMLList); //true
trace(xml1.two is XML); //false
trace(xml1.two is XMLList); //true
trace(xml.ui as XML); //null
trace(xml.ui as XMLList); //값 출력
차이
XML은 최상위 노드가 한개이면 XML
XMLList는 최상위 노드가 여러개 - XML을 여러개 담은 배열
그래서 <xml>은 XML, <ui>는 2개가 있으니까 XMLList
<xml name="XML">
<ui>
<item name="adasd0" ssize="32"/>
<item name="adasd1" ssize="22"/>
<item name="adasd2" ssize="111"/>
<item name="adasd3" ssize="44"/>
</ui>
<translation name="translation"/>
<sound name="sound" play="sndPlay" stop="sndStop" pause="sndPause"/>
<link name="a" index="b"/>
</xml>
ar uLoader:URLLoader = $e.target as URLLoader;
uLoader.removeEventListener(Event.COMPLETE, onComplete);
var xml:XML = XML(uLoader.data);
if (xml)
{
trace(xml); //데이터
trace(typeof uLoader.data); //string
trace(xml is XML); //true
trace(xml is XMLList); //false
trace(xml.ui is XML); //false
trace(xml.ui is XMLList); //true
var xml2:XML = XML(xml.ui); //success
trace(xml.ui.item is XML); //false
trace(xml.ui.item is XMLList); //true
//var xml3:XML = XML(xml.ui.item); //failed
}