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.

See also<br />

addRequestHeader (LoadVars.addRequestHeader method)<br />

contentType (XML.contentType property)<br />

public contentType : String<br />

The MIME content type that is sent to the server when you call the XML.send() or<br />

XML.sendAndLoad() method. The default is application/x-www-form-urlencoded, which<br />

is the st<strong>and</strong>ard MIME content type used for most HTML forms.<br />

Example<br />

The following example creates a new XML document <strong>and</strong> checks its default content type:<br />

// create a new XML document<br />

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

// trace the default content type<br />

trace(doc.contentType); // output: application/x-www-form-urlencoded<br />

The following example defines an XML packet, <strong>and</strong> sets the content type for the XML object.<br />

The data is then sent to a server <strong>and</strong> shows a result in a browser window.<br />

var my_xml:XML = new XML("Ernie13045<br />

");<br />

my_xml.contentType = "text/xml";<br />

my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", "_blank");<br />

Press F12 to test this example in a browser.<br />

See also<br />

send (XML.send method), sendAndLoad (XML.sendAndLoad method)<br />

createElement (XML.createElement method)<br />

public createElement(name:String) : XMLNode<br />

Creates a new XML element with the name specified in the parameter. The new element<br />

initially has no parent, no children, <strong>and</strong> no siblings. The method returns a reference to the<br />

newly created XML object that represents the element. This method <strong>and</strong> the<br />

XML.createTextNode() method are the constructor methods for creating nodes for an XML<br />

object.<br />

Parameters<br />

name:String - The tag name of the XML element being created.<br />

680 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!