XML.cloneNode()
Availability
Flash Player 5.
Usage
my_xml.cloneNode(deep:Boolean) : XMLNode
Parameters
A Boolean value; if set to
deep
recursively cloned.
Returns
An XMLNode object.
Description
Method; constructs and returns a new XML node of the same type, name, value, and attributes as
the specified XML object. If
an exact copy of the original object's document tree.
The clone of the node that is returned is no longer associated with the tree of the cloned item.
Consequently,
nextSibling
parameter is set to
deep
are also
lastChild
Example
The following example shows how to use the
node:
// create a new XML document
var doc:XML = new XML();
// create a root node
var rootNode:XMLNode = doc.createElement("rootNode");
// create three child nodes
var oldest:XMLNode = doc.createElement("oldest");
var middle:XMLNode = doc.createElement("middle");
var youngest:XMLNode = doc.createElement("youngest");
// add the rootNode as the root of the XML document tree
doc.appendChild(rootNode);
// add each of the child nodes as children of rootNode
rootNode.appendChild(oldest);
rootNode.appendChild(middle);
rootNode.appendChild(youngest);
// create a copy of the middle node using cloneNode()
var middle2:XMLNode = middle.cloneNode(false);
, the children of the specified XML object will be
true
is set to
deep
,
parentNode
, or the
false
my_xml
.
null
, all child nodes are recursively cloned, resulting in
true
, and
previousSibling
node has no child nodes,
XML.cloneNode()
all have a value of
null
and
firstChild
method to create a copy of a
XML.cloneNode()
. If the
1017
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?