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.

Returns<br />

XMLNode - An XMLNode object; an XML element.<br />

Example<br />

The following example creates three XML nodes using the createElement() method:<br />

// create an XML document<br />

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

// create three XML nodes using createElement()<br />

var element1:XMLNode = doc.createElement("element1");<br />

var element2:XMLNode = doc.createElement("element2");<br />

var element3:XMLNode = doc.createElement("element3");<br />

// place the new nodes into the XML tree<br />

doc.appendChild(element1);<br />

element1.appendChild(element2);<br />

element1.appendChild(element3);<br />

trace(doc);<br />

// output: <br />

See also<br />

createTextNode (XML.createTextNode method)<br />

createTextNode (XML.createTextNode method)<br />

public createTextNode(value:String) : XMLNode<br />

Creates a new XML text node with the specified text. The new node initially has no parent,<br />

<strong>and</strong> text nodes cannot have children or siblings. This method returns a reference to the XML<br />

object that represents the new text node. This method <strong>and</strong> the XML.createElement()<br />

method are the constructor methods for creating nodes for an XML object.<br />

Parameters<br />

value:String - A string; the text used to create the new text node.<br />

Returns<br />

XMLNode - An XMLNode object.<br />

Example<br />

The following example creates two XML text nodes using the createTextNode() method,<br />

<strong>and</strong> places them into existing XML nodes:<br />

XML 681

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

Saved successfully!

Ooh no, something went wrong!