
XML.previousSibling
473
Description
Method; parses the XML text specified in the
source
parameter, and populates the specified
XML object with the resulting XML tree. Any existing trees in the XML object are discarded.
Example
The following example creates and parses an XML packet:
var xml_str:String = "<state name=\"California\">
<city>San Francisco</city></state>"
// defining the XML source within the XML constructor:
var my1_xml:XML = new XML(xml_str);
trace(my1_xml.firstChild.attributes.name); // output: California
// defining the XML source using the XML.parseXML method:
var my2_xml:XML = new XML();
my2_xml.parseXML(xml_str);
trace(my2_xml.firstChild.attributes.name); // output: California
XML.previousSibling
Availability
Flash Player 5.
Usage
my_xml
.previousSibling
:XMLNode
Description
Read-only property; an XMLNode value that references the previous sibling in the parent node’s
child list. The property has a value of
null
if the node does not have a previous sibling node. This
property cannot be used to manipulate child nodes; use the
XML.appendChild()
,
XML.insertBefore()
, and
XML.removeNode()
methods to manipulate child nodes.
Example
The following example is an excerpt from the example for the
XML.lastChild
property, and
shows how you can use the
XML.previousSibling
property to loop through an XML node’s
child nodes:
for (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode =
aNode.previousSibling) {
trace(aNode);
}
See also
XML.appendChild()
,
XML.insertBefore()
,
XML.removeNode()
,
XMLNode class
Содержание FLEX-FLEX ACTIONSCRIPT LANGUAGE
Страница 1: ...Flex ActionScript Language Reference...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Страница 135: ...case 135 See also break default strict equality switch...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in...
Страница 808: ...808 Chapter 7 ActionScript for Flash...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Страница 822: ...822 Index...