MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 125

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 124
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
122
Example
The following example creates three XMLNode objects by using the
createElement() method:
// Create an XML document.
var doc = new XML();
// Create three XML nodes by using createElement().
var element1 = doc.createElement("element1");
var element2 = doc.createElement("element2");
var element3 = doc.createElement("element3");
// Place the new nodes into the XML tree.
doc.appendChild(element1);
element1.appendChild(element2);
element1.appendChild(element3);
trace(doc);
// Output: <element1><element2 /><element3 /></element1>
See also
XML.createTextNode()
XML.createTextNode()
my_xml.createTextNode(text)
Creates a new XML text node with the specified text. The new node initially has no parent, and text nodes cannot
have children or siblings. This method returns a reference to the XML object that represents the new text node. This
method and the
XML.createElement() method are the constructor methods for creating nodes for an XML object.
Availability
Flash Media Server 2
Parameters
text A string; the text used to create the new text node.
Returns
An XML node.
Example
The following example creates two XML text nodes by using the
createTextNode() method and places them into
existing XML nodes:
// Create an XML document.
var doc = new XML();
// Create three XML nodes by using createElement().
var element1 = doc.createElement("element1");
var element2 = doc.createElement("element2");
var element3 = doc.createElement("element3");
// Place the new nodes into the XML tree.
doc.appendChild(element1);
element1.appendChild(element2);
element1.appendChild(element3);
// Create two XML text nodes by using createTextNode().
Vedere la pagina 124
1 2 ... 120 121 122 123 124 125 126 127 128 129 130 ... 154 155

Commenti su questo manuale

Nessun commento