Xml.xmldecl - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

XML.xmlDecl

Availability
Flash Player 5.
Usage
my_xml.xmlDecl:String
Description
Property; a string that specifies information about a document's XML declaration. After the XML
document is parsed into an XML object, this property is set to the text of the document's XML
declaration. This property is set using a string representation of the XML declaration, not an
XML node object. If no XML declaration is encountered during a parse operation, the property is
set to
undefined
property before any other text in the XML object. If the
type, no XML declaration is output.
undefined
Example
The following example creates a text field called
Stage. The text field displays properties of the XML packet that loads into the SWF file. The doc
type declaration displays in
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "_typewriter";
my_fmt.size = 12;
my_fmt.leftMargin = 10;
this.createTextField("my_txt", this.getNextHighestDepth(), 0, 0, Stage.width,
Stage.height);
my_txt.border = true;
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.setNewTextFormat(my_fmt);
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
var endTime:Number = getTimer();
var elapsedTime:Number = endTime-startTime;
if (success) {
my_txt.text = "xmlDecl:"+newline+my_xml.xmlDecl+newline+newline;
my_txt.text += "contentType:"+newline+my_xml.contentType+newline+newline;
my_txt.text += "docTypeDecl:"+newline+my_xml.docTypeDecl+newline+newline;
my_txt.text += "packet:"+newline+my_xml.toString()+newline+newline;
} else {
my_txt.text = "Unable to load remote XML."+newline+newline;
}
my_txt.text += "loaded in: "+elapsedTime+" ms.";
};
my_xml.load("http://www.flash-mx.com/crossdomain.xml");
var startTime:Number = getTimer();
1056
Chapter 2: ActionScript Language Reference
.
The
XML.
XML.toString()
. Add the following ActionScript to your FLA or AS file:
my_txt
method outputs the contents of the
XML.xmlDecl
that has the same dimensions as the
my_txt
XML.xmlDecl
property contains the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx

Table of Contents