User Guide

1296 ActionScript classes
<department id="IT">
Information Technology
</department>
You must use the parseXML() method on the XML object for the idMap property to be
instantiated.
If there is more than one XMLNode with the same
id value, the matching property of the
idNode object is that of the last node parsed, as follows:
var x1:XML = new XML("<a id='1'><b id='2' /><c id='1' /></a>");
x2 = new XML();
x2.parseXML(x1);
trace (x2.idMap['1']);
The following will output the <c> node:
<c id='1' />
Availability: ActionScript 1.0; Flash Player 8
Example
You can create a text file named
idMapTest.xml that contains the following text.
<?xml version="1.0"?>
<doc xml:base="http://example.org/today/" xmlns:xlink="http://www.w3.org/
1999/xlink">
<head>
<title>Virtual Library</title>
</head>
<body>
<paragraph id="linkP1">See <link xlink:type="simple"
xlink:href="new.xml">what's
new</link>!</paragraph>
<paragraph>Check out the hot picks of the day!</paragraph>
<olist xml:base="/hotpicks/">
<item>
<link id="foo" xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</
link>
</item>
<item>
<link id="bar" xlink:type="simple" xlink:href="pick2.xml">Hot Pick #2</
link>
</item>
<item>
<link xlink:type="simple" xlink:href="pick3.xml">Hot Pick #3</link>
</item>
</olist>
</body>
</doc>