how to read xml nodes in as3.....
Copy link to clipboard
Copied
Hi i m able to read xml node's attribute but i required to save whole node value to my movieclip object here my xml
<xml>
<node thumb='images/t1.jpg' bigswf='images/t1.swf' catagoery='t1 link' link='tl.xml'/>
<node thumb='images/t2.jpg' bigswf='images/t2.swf' catagoery='t2 link' link='t2.xml'/>
<node thumb='images/t3.jpg' bigswf='images/t3.swf' catagoery='t3 link' link='t3.xml'/>
</xml>
when i trace xml.node[0].@thumb then i got output>>images/t1.jpg
how can i get value of full node like this >>> <node thumb='images/t1.jpg' bigswf='images/t1.swf' catagoery='t1 link' link='tl.xml'/>
I m trying xml.node[0] but it shows nothing...
Copy link to clipboard
Copied
your xml data can be made into an xmlList, each node could be an item in the list
xmlList[0]
Copy link to clipboard
Copied
I tried this, but it dosent work
var xm:XMLList=XMLList(xml.node[0)
trace(xm)<<<this shows nothing
Copy link to clipboard
Copied
var xml:XML = <xml>
<node thumb='images/t1.jpg' bigswf='images/t1.swf' catagoery='t1 link' link='tl.xml'/>
<node thumb='images/t2.jpg' bigswf='images/t2.swf' catagoery='t2 link' link='t2.xml'/>
<node thumb='images/t3.jpg' bigswf='images/t3.swf' catagoery='t3 link' link='t3.xml'/>
</xml>
var list:XMLList = xml.node;
trace(list[0].toXMLString());
Copy link to clipboard
Copied
by this way xml data will be change to string.. can i use this as xml data
var list:XMLList = xml.node;
var xmlnode:string=list[0].toXMLString() <<<< can i extract thumb attribute value from this node value?. because now it goes to a string value..
;
Copy link to clipboard
Copied
yes
list[0].@thumb

