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

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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
method are the constructor methods for creating nodes for an XML
XML.createTextNode()
object.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- The tag name of the XML element being created.
name:String
Returns
- An XMLNode object; an XML element.
XMLNode
XML
721

Advertisement

Table of Contents
loading

Table of Contents