About XML 653
Every XML tag is called a node, or an element. Each node has a type (1, which indicates an
XML element, or 3, which indicates a text node), and elements might also have attributes. A
node nested in a node is called a child node. This hierarchical tree structure of nodes is called
the XML DOM—much like the JavaScript DOM, which is the structure of elements in a
web browser.
In the following example,
<portfolio> is the parent node; it has no attributes and contains
the child node
<holding>, which has the attributes symbol, qty, price, and value:
<portfolio>
<holding symbol="rich"
qty="75"
price="245.50"
value="18412.50" />
</portfolio>
For more information, see the following topics:
■ “Using the XML class” on page 654
■ “Using the XMLSocket class” on page 661
For more information on XML, see www.w3.org/XML.
There are several sample files on your hard disk that load XML into a SWF file at runtime.
One sample demonstrates how to create a web log tracker by loading, parsing, and
manipulating XML data. You can find the sample source file, xml_blogTracker.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\XML_BlogTracker.
■ On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/XML_BlogTracker.
A second sample demonstrates how to use XML and nested arrays to select strings of different
languages to populate text fields. You can find the sample source file, xml_languagePicker.fla,
in the Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\XML_LanguagePicker.
■ On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/XML_LanguagePicker.