I'm trying to figure out the new xml structure in AS3. I know I can use the XMLdocument class and go back tothe old way of doing thinsg but I don't want to do that if I can help it.
So I have an AS3 Air app which is successfully reading and writing to an XML file. Now I want to replace an attribute or an entire node if that's easier but I can't figure out how to target it.
So the XML starts with an empty node:
and I append to nodes that take the following form:
What I want to know is how to target the status node (or any other node for that matter) so that I can replace it or it's attribute. So, let's say I have a bunch of these guest nodes and I want to change the status for the first one, how do I do that using the new syntax.
I'd appreciate any help you can give.
if there's only one guest node:
if you have more than one guest node, you can use array notation to indicate which guest node:
I can't thank you enough for this. It's so simple that it makes me want to scream has I have been circling around this for hours. So for those who may read this and want to know how I changed the value of the child node . . . here it is:
guestDataXML.guest[index].status = currentStatus;
index holds the index and currentStatus holds the value to which I want the node to change.
Thank you again.