javascript - E4X : Assigning to root node -


i using adobe flex/air here, far know applies of javascript. have come across problem few times, , there must easy solution out there!

suppose have following xml (using e4x):

var xml:xml = <root><example>foo</example></root> 

i can change contents of example node using following code:

xml.example = "bar"; 

however, if have this:

var xml:xml = <root>foo</root> 

how change contents of root node?

xml = "bar"; 

obviously doesn't work i'm attempting assign string xml object.

it seems confuse variables values contain. assignment

node = textinput.text; 

changes value variable node points to, doesn't change object node points to. want can use setchildren method of xml class:

node.setchildren(textinput.text) 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -