MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 452

Actionscript language reference
Table of Contents

Advertisement

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);
// 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 />
//
<middle />
//
<middle />
//
<youngest />
452
Chapter 6: ActionScript Core Classes
, 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
. If the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents