A tutorial on flash calling XML data

Source: Internet
Author: User
The following is a brief introduction to the tutorial of Flash calling XML data

First, create XML objects:
var myxml= New XML ();

Second, the reference XML file:
Myxml.load("Pro.xml");
Third, ignore the space://The default is False

Myxml.ignoRewhite =True
Iv. Processing XML objectsFunction:
Myxml.onloAD = FunctIon (success) {Statements;}
Five, Pro. XML textThe contents of a piece
<productsName= "Good"><productName= "WelL "&GT;WYU&LT;/PROduct><proDuct Name="Better" >wYu2</produCt></produCts>
Six, Test return value 1,Myxml.chilDnodes[0] WillReturn:
<productsName= "Good">
<product NAme= "OK">wyu</prodUct>
<product NAme= "BetteR ">wyu2</pRoduct>
</products>

2, myxml.chIldnodes[0].nodenamewill return:
Good
3, myxml.chIldnodes[0].childnodEs[0].namewill return:
So
4, myxml.chIldnodes[0].childnodEs[0] will return:
<product NAme= "OK">
Wyu
</product>

5, myxml.chIldnodes[0].childnodEs[0].nodeName will return:
So
6, myxml.chIldnodes[0].childnodEs[1].attrIbutes.namE will return:
Better
7, myxml.chIldnodes[0].childnodEs[0].chilDnodes[0].NodeValue willReturn:
Wyu
8,
var myname= MYXML.FIrstchild.FirstChild;
Trace (MynaMe.nodename);//Will output well
MyName = mYname.nextsibling;
Trace (MynaMe.nodename);//Will output beTter ChildNodes[0] EquivalenceIn FirstchilD
Seven, test code
var myxml= New XML ();
Myxml.load("Pro.xml");
Myxml.ignoRewhite =True
Myxml.onloAD = FunctIon (success) {
if (success) {
MyArray =Myxml.chilDnodes[0];
Trace (MyarRay.attribUtes.name);
/*trace (myXml.childnodes[0].chIldnodes[1].firstchiLd.nodevalUE);
Trace (MYXML.firstchiLD);
Trace (MYXML.childnodEs[0].nodeName);
Trace (MYXML.firstchiLd.attribuTes.name);
Trace (MYXML.childnodEs[0].chilDNODES[1].NodeName);
Trace (MYXML.childnodEs[0].chilDNODES[1].Attributes. name);
Trace (MYXML.firstchiLd.firstchILD);
Trace (MYXML.firstchiLd.firstchIld.nodenaME);
Trace (MYXML.firstchiLd.firstchIld.attribUtes.name);
Trace (MYXML.childnodEs[0].chilDnodes[0].ChildNodes[0].nodevaLue);
var myname= MYXML.FIrstchild.FirstChild;
Trace (MynaMe.nodename);
MyName = mYname.nextsibling;
Trace (MynaMe.nodename);
}
};



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.