EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Createelement (Xml.createelement Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
XML 721
Example
The following example creates a new XML document and checks its default content type:
// create a new XML document
var doc:XML = new XML();
// trace the default content type
trace(doc.contentType); // output: application/x-www-form-urlencoded
The following example defines an XML packet, and sets the content type for the XML object.
The data is then sent to a server and shows a result in a browser window.
var my_xml:XML = new XML("<highscore><name>Ernie</name><score>13045</score>
</highscore>");
my_xml.contentType = "text/xml";
my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", "_blank");
Press F12 to test this example in a browser.
See also
send (XML.send method), sendAndLoad (XML.sendAndLoad method)
createElement (XML.createElement method)
public createElement(name:String) : XMLNode
Creates a new XML element with the name specified in the parameter. The new element
initially has no parent, no children, and no siblings. The method returns a reference to the
newly created XML object that represents the element. This method and the
XML.createTextNode() method are the constructor methods for creating nodes for an XML
object.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
name:String - The tag name of the XML element being created.
Returns
XMLNode - An XMLNode object; an XML element.

Table of Contents

Related product manuals