03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Example<br />

The following example loads an XML file with a text node that contains only white space; the<br />

foyer tag comprises fourteen space characters. To run this example, create a text file named<br />

flooring.xml, <strong>and</strong> copy the following tags into it:<br />

<br />

ceramic tile <br />

linoleum<br />

<br />

<br />

Create a new Flash document named flooring.fla <strong>and</strong> save it to the same directory as the XML<br />

file. Place the following code into the main Timeline:<br />

// create a new XML object<br />

var flooring:XML = new XML();<br />

// set the ignoreWhite property to true (default value is false)<br />

flooring.ignoreWhite = true;<br />

// After loading is complete, trace the XML object<br />

flooring.onLoad = function(success:Boolean) {<br />

trace(flooring);<br />

}<br />

// load the XML into the flooring object<br />

flooring.load("flooring.xml");<br />

// output (line breaks added for clarity):<br />

<br />

ceramic tile <br />

linoleum<br />

<br />

<br />

If you then change the setting of flooring.ignoreWhite to false, or simply remove that<br />

line of code entirely, the fourteen space characters in the foyer tag will be preserved:<br />

...<br />

// set the ignoreWhite property to false (default value)<br />

flooring.ignoreWhite = false;<br />

...<br />

// output (line breaks added for clarity):<br />

<br />

ceramic tile <br />

linoleum<br />

<br />

<br />

XML 685

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

Saved successfully!

Ooh no, something went wrong!