Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to read xml nodes in as3.....

Explorer ,
Dec 04, 2011 Dec 04, 2011

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...

TOPICS
ActionScript
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 04, 2011 Dec 04, 2011

your xml data can be made into an xmlList, each node could be an item in the list

xmlList[0]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 04, 2011 Dec 04, 2011

I tried this, but it dosent work

var xm:XMLList=XMLList(xml.node[0)

trace(xm)<<<this shows nothing

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 04, 2011 Dec 04, 2011

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());

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 04, 2011 Dec 04, 2011

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..

;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 04, 2011 Dec 04, 2011
LATEST

yes

list[0].@thumb

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines