User Guide
XML 1297
Then you can create a SWF file in the same directory as the XML file. You can include the
following script in the SWF.
var readXML = new XML();
readXML.load("idMapTest.xml");
readXML.onLoad = function(success) {
myXML = new XML();
myXML.parseXML(readXML);
for (var x in myXML.idMap){
trace('idMap.' + x + " = " + newline + myXML.idMap[x]);
trace('____________' + newline);
}
}
When you test the SWF file, the following output is generated.
idMap.bar =
<link id="bar" xlink:type="simple" xlink:href="pick2.xml">Hot Pick #2</
link>
____________
idMap.foo =
<link id="foo" xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</
link>
____________
idMap.linkP1 =
<paragraph id="linkP1">See <link xlink:type="simple"
xlink:href="new.xml">what's
new</link>!</paragraph>
____________
ignoreWhite (XML.ignoreWhite property)
public ignoreWhite : Boolean
Default setting is false. When set to true, text nodes that contain only white space are
discarded during the parsing process. Text nodes with leading or trailing white space are
unaffected.
Usage 1: You can set the
ignoreWhite property for individual XML objects, as the following
code shows:
my_xml.ignoreWhite = true;
Usage 2: You can set the default ignoreWhite property for XML objects, as the following
code shows:
XML.prototype.ignoreWhite = true;