Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / August 2006



Tip: Looking for answers? Try searching our database.

updating XML data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Goo101 - 21 Aug 2006 15:00 GMT
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?
Goo101 - 21 Aug 2006 17:29 GMT
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) . . .
Goo101 - 22 Aug 2006 09:47 GMT
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!
-->dan mode - 28 Aug 2006 22:58 GMT
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

Signature

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

> 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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.