XML.contentType Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
XML.contentType Property Flash 5.0.41.0

MIME content type for XML data sent via XML.send( ) and XML.sendAndLoad( ) read/write
xmlDoc.contentTypeAccess

Description

The contentType property is the MIME type that is sent to a server when XML.send( ) or XML.sendAndLoad( ) is invoked. It defaults to "application/x-www-form-urlencoded", but that MIME type is used only cosmetically to encourage interoperability with server-side applications; the data sent is not URL-encoded. The specified xmlDoc must be the top-level node in an XML object hierarchy (i.e., an instance of the XML class, not the XMLnode class). When set on an individual XML instance, the contentType property affects only that instance. For example, the following code sets the MIME for doc only:

doc.contentType = "application/xml";

To affect all XML objects, set the value of XML.prototype.contentType. For example, the following code sets the MIME of all XML objects in a movie to "application/xml":

XML.prototype.contentType = "application/xml";

The contentType property first appeared in Flash Player 5.0.41.0, before which it was not possible to set the MIME type. Check contentType's validity in the Player by comparing it to undefined, or use the getVersion( ) function to determine the Player version and build.

See Also

XML.send( ), XML.sendAndLoad( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net