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.

eak;<br />

case -5 :<br />

errorMessage = "A comment was not properly terminated.";<br />

break;<br />

case -6 :<br />

errorMessage = "An XML element was malformed.";<br />

break;<br />

case -7 :<br />

errorMessage = "Out of memory.";<br />

break;<br />

case -8 :<br />

errorMessage = "An attribute value was not properly terminated.";<br />

break;<br />

case -9 :<br />

errorMessage = "A start-tag was not matched with an end-tag.";<br />

break;<br />

case -10 :<br />

errorMessage = "An end-tag was encountered without a matching<br />

start-tag.";<br />

break;<br />

default :<br />

errorMessage = "An unknown error has occurred.";<br />

break;<br />

}<br />

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

} else {<br />

trace("Unable to load/parse XML. (status: "+my_xml.status+")");<br />

}<br />

};<br />

my_xml.load("http://www.helpexamples.com/flash/badxml.xml");<br />

XML constructor<br />

public XML(text:String)<br />

Creates a new XML object. You must use the constructor to create an XML object before you<br />

call any of the methods of the XML class.<br />

Note: Use the createElement() <strong>and</strong> createTextNode() methods to add elements <strong>and</strong> text<br />

nodes to an XML document tree.<br />

Parameters<br />

text:String - A string; the XML text parsed to create the new XML object.<br />

Example<br />

The following example creates a new, empty XML object:<br />

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

694 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!