MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1319

Actionscript 2.0 language reference
Table of Contents

Advertisement

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 Player 5
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);
// insert the clone node into rootNode between the middle and youngest nodes
rootNode.insertBefore(middle2, youngest);
trace(rootNode);
// output (with line breaks added):
// <rootNode>
// <oldest />
,
, and
parentNode
previousSibling
, or the
false
my_xml
, the children of the specified XML object will
true
XML.cloneNode()
all have a value of
node has no child nodes,
method to create a copy of a
. If
null
and
firstChild
XMLNode
1319

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents