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.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...