PDA

View Full Version : XML and Flash ActionScript



krist_foo
February 12th, 2004, 04:52 AM
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);

Jubba
February 12th, 2004, 12:11 PM
http://www.kirupa.com/developer/actionscript/xmlfromflash.htm

krist_foo
February 12th, 2004, 07:56 PM
Thanks. This site I have visited and follow the intstruction there but my xml file is not updated with the new data although process has been carried out successfully. Please help me again. Thanks.

:)

λ
February 18th, 2004, 02:27 AM
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.

krist_foo
February 18th, 2004, 02:53 AM
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.....

upuaut
February 18th, 2004, 05:19 AM
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.

λ
February 18th, 2004, 05:23 AM
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.

krist_foo
February 18th, 2004, 10:41 PM
thank you all of u. i will try.