03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Then you can create a SWF file in the same directory as the XML file. You can include the<br />

following script in the SWF.<br />

var readXML = new XML();<br />

readXML.load("idMapTest.xml");<br />

readXML.onLoad = function(success) {<br />

myXML = new XML();<br />

myXML.parseXML(readXML);<br />

for (var x in myXML.idMap){<br />

trace('idMap.' + x + " = " + newline + myXML.idMap[x]);<br />

trace('____________' + newline);<br />

}<br />

}<br />

When you test the SWF file, the following output is generated.<br />

idMap.bar =<br />

Hot Pick #2<br />

____________<br />

idMap.foo =<br />

Hot Pick #1<br />

____________<br />

idMap.linkP1 =<br />

See what's<br />

new!<br />

____________<br />

ignoreWhite (XML.ignoreWhite property)<br />

public ignoreWhite : Boolean<br />

Default setting is false. When set to true, text nodes that contain only white space are<br />

discarded during the parsing process. Text nodes with leading or trailing white space are<br />

unaffected.<br />

Usage 1: You can set the ignoreWhite property for individual XML objects, as the following<br />

code shows:<br />

my_xml.ignoreWhite = true;<br />

Usage 2: You can set the default ignoreWhite property for XML objects, as the following<br />

code shows:<br />

XML.prototype.ignoreWhite = true;<br />

1318 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!