all groups > flash data integration > august 2006 >
You're in the

flash data integration

group:

updating XML data


updating XML data Goo101
8/21/2006 2:00:26 PM
flash data integration: I have the following code in place to move a variable from my Flash app to an
XML file for storage . . .

//replace the GoodVN value in the XML file with the latest valid voucher
number
var VoucherNumbers:XML = new
XML("<VoucherNumbers><GoodVoucher>VoucherNo</GoodVoucher> </VoucherNumbers>");
VoucherNumbers.contentType = "text/xml";
VoucherNumbers.send("VoucherNumbers.xml");

But this is not working. I cannot use LoadVars as it is meant for use with a
..txt file. I have tried other variations on this code but with little success.

My XML file has the following layout . . .

<?xml version="1.0" encoding="UTF-8" ?>
- <VoucherNumbers>
<GoodVoucher>20060820151601</GoodVoucher>
- <CancelVoucher>
<CancelledVoucher>20060820091501</CancelledVoucher>
<CancelledVoucher>20060820102201</CancelledVoucher>
<CancelledVoucher>20060820105401</CancelledVoucher>
<CancelledVoucher>20060820114201</CancelledVoucher>
</CancelVoucher>
</VoucherNumbers>

So . . . how do I go about getting my VoucherNo variable from Flash to replace
the value in the GoodVoucher field in my XML file?


Re: updating XML data Goo101
8/21/2006 4:29:24 PM
Can I use the 'new XMLNode' and 'removeNode' methods to update the XML file?

i.e. I don't update the data directly by overwriting the text in the relevant
xml field but rather remove the node and replace it (with it's new value) . . .

Re: updating XML data Goo101
8/22/2006 12:00:00 AM
Why can't you use the .send method to load data into a locally stored XML file?
Can anyone out there please answer my question!? I find it absurd that you can
read data in from a locally stored XML object but not update or write to it!
Re: updating XML data -->dan mode
8/28/2006 3:58:27 PM
Flash is read only. You need some sort of serverside script to write data to
a file. php, cfm, asp, cgi or perl.

There is a sample here that uses php to update an xml file that displays a
guestbook:
http://www.kirupa.com/web/xml_guestbook3.htm


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog


[quoted text, click to view]

AddThis Social Bookmark Button