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

Create successful ePaper yourself

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

Example<br />

The following simple example uses the XML.load() method:<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) {<br />

trace(flooring);<br />

};<br />

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

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

For the contents of the flooring.xml file, <strong>and</strong> the output that this example produces, see the<br />

example for XML.ignoreWhite.<br />

See also<br />

ignoreWhite (XML.ignoreWhite property), loaded (XML.loaded property), onLoad<br />

(XML.onLoad h<strong>and</strong>ler)<br />

loaded (XML.loaded property)<br />

public loaded : Boolean<br />

Indicates if the XML document has successfully loaded. If there is no custom onLoad() event<br />

h<strong>and</strong>ler defined for the XML object, then this property is set to true when the documentloading<br />

process initiated by the XML.load() call has completed successfully; otherwise, it is<br />

false. However, if you define a custom behavior for the onLoad() event h<strong>and</strong>ler for the<br />

XML object, be sure to set onload in that function.<br />

Example<br />

The following example uses the XML.loaded property in a simple script:<br />

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

my_xml.ignoreWhite = true;<br />

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

trace("success: "+success);<br />

trace("loaded: "+my_xml.loaded);<br />

trace("status: "+my_xml.status);<br />

};<br />

my_xml.load("http://www.flash-mx.com/mm/problems/products.xml");<br />

XML 687

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

Saved successfully!

Ooh no, something went wrong!