PDA

View Full Version : Read and then RE-WRITE XML...


MSFX
04-10-2008, 09:04 PM
I feel this is going to be a tricky one :eek: "wooooo!"

I need to do this is AS3, I have posted in the AS3 forums, 50+ views and no response :(

So now asking, how do you do it in AS2, and will then try to convert, YAY! ;) :(

I have an XML file with some data, which is loaded into Flash. This data is then modified and needs to be updated with the server, by rewriting the XML file. I know it can be done, i'm guessing using some kind of awesome server side scripting however I dont know how...

Any pointers, examples, tut's etc would be very much appreciated...

Just in case you know how to do this is AS3, here (http://www.actionscript.org/forums/showthread.php3?t=166938) is the link...

xxneon
04-10-2008, 09:37 PM
XML.send() would send the current xml structure of your xml object.. and then your serverside script just needs to read in the raw post data (if you send it via post).. since the xml will just be text and not a variable value pair.. and then once the serverscript has the new xml content.. have it overwrite the desired file..

and if you dont want to leave the flash .. use sendAndLoad.. similar to how you use sendAndLoad for LoadVars..

asf8
04-10-2008, 09:45 PM
I have an XML file with some data, which is loaded into Flash. This data is then modified and needs to be updated with the server, by rewriting the XML file. I know it can be done, i'm guessing using some kind of awesome server side scripting however I dont know how...

Maybe these examples from Senoculars XML tutorial will help ?

http://www.kirupa.com/web/xml/XMLsending1.htm
http://www.kirupa.com/web/xml/examples/simpleeditor.htm
http://www.kirupa.com/web/xml/examples/newseditor.htm

They relate to what xxneon is talking about and have a few little sample to play with.

asf8
04-10-2008, 10:06 PM
I just remembered this nice little example by inhan also that you might find interesting. http://www.actionscript.org/forums/showthread.php3?t=160955

and if you dont want to leave the flash .. use sendAndLoad.. similar to how you use sendAndLoad for LoadVars..

@xxneon -- So can it be accomplished ALL in Flash then without serverside ?

xxneon
04-11-2008, 02:40 AM
no, sendAndLoad would still be sending the xml to the serverside.. the only way you can do it with only flash is if you were use a 3rd party projector and the xml file was local... and even at that you really can't say its only flash ... hehe cause you have added functionality because of the 3rd party.

asf8
04-11-2008, 03:08 AM
no, sendAndLoad would still be sending the xml to the serverside.. the only way you can do it with only flash is if you were use a 3rd party projector and the xml file was local... and even at that you really can't say its only flash ... hehe cause you have added functionality because of the 3rd party.

Ah ok, you got me excited for a second, maybe someday ;)

MSFX
04-16-2008, 09:15 AM
Wow, nice one guys, knew I could rely on you two (three really) for some quality comeback ;)

rahulkathet
04-24-2009, 12:13 PM
Wow, nice one guys, knew I could rely on you two (three really) for some quality comeback ;)

Hi I need help in Flash, I am working in one project there i am not using any backend script, i need to ad xml and rewrite it through flash itself, is this is possible if yes, you have any suggestion or help.

thanks