Clonenode (Xmlnode.clonenode Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

cloneNode (XMLNode.cloneNode method)

public cloneNode(deep:Boolean) : XMLNode
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
the
parameter is set to
deep
are also null.
lastChild
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A Boolean value; if set to
deep:Boolean
be recursively cloned.
Returns
- An XMLNode Object.
XMLNode
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);
744
ActionScript classes
is set to
, all child nodes are recursively cloned, resulting in
deep
true
,
, and
parentNode
, or the
false
my_xml
true
XML.cloneNode()
all have a value of
previousSibling
node has no child nodes,
, the children of the specified XML object will
method to create a copy of a
. If
null
and
firstChild

Advertisement

Table of Contents
loading

Table of Contents