|
|
Question : Flash XML variable appending or combining
|
|
Say I have the following XML output
2007-10-06 17:26:33 Anonymous ALL test message
And I load it up into my Flash variable chatXML:XML; Which works fine, Now a new message has been added to the chatrrom
2007-10-06 17:27:48 Anonymous ALL New Message at 5:27 test
Presently I can reload my chatXML variable with the new outpput and add the new message to the display. Is there a way I can combine the two XML outputs into one variable to retain the old information? And also rather than making my XML output produce all messages each go for a lot of wasted redundancy.
I'm thinking that maybe I could do something like use a new var tempXML and somehow use newID= tempXML.chat.message.@id to add tempXML.chat.message.(@id==newID) to chatXML.chat
Thanks for the help!!
|
Answer : Flash XML variable appending or combining
|
|
How is the XML coming into flash? Are you receiving discrete XML blocks in separate requests the way you have written them here in the example code you provided, or is it all one file? I mean, when a new chat message is sent, is it in an XML stream all by itself, or are you re-sending all the chat messages that came before it as well?
Have you tried chatXML.chat.appendChild (tempXML.chat.message)?
|
|
|
|