Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Replacing an XML node

Replacing an XML node

2004-02-13       - By Collin Peters

 Back
Reply:     1     2     3     4     5     6     7  

The following code doesn 't update the XML:

================================================

var xml1 = new XML( " <root > <node id= '1 '/ > <node id= '2 '/ > </root > ");

trace(xml1);

var newNode = new XML( " <node id= '3 '/ > ");

xml1.firstChild.childNodes[0] = newNode.firstChild;

trace(xml1);

=================================================

The output is:
<root > <node id= "1 " / > <node id= "2 " / > </root >
<root > <node id= "1 " / > <node id= "2 " / > </root >


Is there anyway to easily update a node in this manner?

Regards,
Collin

=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104210
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)