# XML and Flash ActionScript

**URL:** https://forum.kirupa.com/t/xml-and-flash-actionscript/101649
**Category:** Uncategorized
**Created:** [February 12, 2004, 9:52am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649 "2004-02-12T09:52:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![krist\_foo](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@krist\_foo](https://forum.kirupa.com/u/krist_foo)
#### Post date: [February 12, 2004, 9:52am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/1 "2004-02-12T09:52:44Z")

</div>

below is the code snippet that i used to write data in xml file. but it dun seem to work. can any one assit me?? thanks.

my\_test = new XML();  
my\_test.ignoreWhite = true;  
function myload() {  
trace(my\_test.toString());  
trace(my\_test.firstChild.firstChild.childNodes[1]);  
my\_test.firstChild.firstChild.insertBefore(my\_test.createElement(“NRIC”), my\_test.firstChild.firstChild.childNodes[1]);  
my\_test.firstChild.firstChild.childNodes[1].appendChild( my\_test.createTextNode(“S8282828Z”) );  
trace(my\_test);

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 18, 2004, 7:27am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/2 "2004-02-18T07:27:14Z")

</div>

That’s cause you haven’t actually written it to a file.

You need to store it, either in a SharedObject(client-side) or by using PHP or some other server-side language.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 18, 2004, 7:53am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/3 "2004-02-18T07:53:09Z")

</div>

so u mean my coding is incompleted??? But I thought once I put the send command the data will be automatically uodated in the XML file??? my aim is very simple. I will be using only flash actionscript to write data to an XML file. that’s all. Is it possible?? pls give me a general guide.

thanks…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 18, 2004, 10:19am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/4 "2004-02-18T10:19:45Z")

</div>

it is possible, but what he’s saying is that the Flash end of it can only build the xml object and then send that object to the server. On your server you need a php file which will write that data to a txt file.

I would do a search in this forum, and in the actionscript forum using the key words “writing+text+php+xml” in the search field. I’ll bet you come up with at least 4 convo’s we’ve had on this subject. If you have questions on one of those, and or how to impliment something, or obviously if you can’t find anything… write back.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 18, 2004, 10:23am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/5 "2004-02-18T10:23:47Z")

</div>

> \*Originally posted by krist\_foo \*  
> \*\*so u mean my coding is incompleted??? But I thought once I put the send command the data will be automatically uodated in the XML file??? my aim is very simple. I will be using only flash actionscript to write data to an XML file. that’s all. Is it possible?? pls give me a general guide.

thanks… \*\*

using **only** Flash, it is impossible to write to an XML file on a server.

You can write it to the clients PC though… there’s a SharedObject tutorial in the tutorial section.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 19, 2004, 3:41am UTC](https://forum.kirupa.com/t/xml-and-flash-actionscript/101649/6 "2004-02-19T03:41:13Z")

</div>

thank you all of u. i will try.
