I know you can import an XML file to supply Flash with data but is it possible to create an XML file from data held in variable/ array in Flash to be saved locally or on a web server ?
If so how would one do such a thing…how are the nodes and children created etc ?
i believe you can construct the xml, however, saving it would be an issue. I’m really not sure if you can save date into a file from flash… But… i believe you can use a server, and send the text to the server where an PHP or an ASP.Net or ASP app could save that data…
I’d have to look into it more. =) im intrigued.
I see what you mean…If I were for example to create from scratch many records in an array consisting of the following field/variables:
Name
Address
Age
Phone
Interests
How would I create the structured XML file ?..I wonder if senocular could help on this one given that he wrote the tutorial.
I know you can load XML from a local file or web server…I do not want to load as I have the data in flash I want to create and save an xml file locally or to a web server.
This would be really useful for others I am sure…senocular are you around ???
well you would create the XML inflash, and there are methods that support that, and then you send that object or text (whatever it is…) to a webserver in which you’d have a web application running waiting to accept that file and write it out and save it.
I could make an example for you tonight, hopefully be done by tomarrow =)
<people>
<person>
<name>somebody</name>
<address>right here</address>
<tel>12345678</tel>
<interests>drinking</interests>
</person>
<person>
<name>somebody2</name>
<address>right here2</address>
<tel>00000000</tel>
<interests>drinking & dancing</interests>
</person>
</people>
I know this is not PHP but how do I post XML tags in this forum ????
How would the array get turned in the XML structure as above ??..
Could the xml above then be saved into a text file but with an .xml extension ???
I also need the chioce to save this locally or to a web sever for retrieval at a later date.
well php has functionality (or should ) to write files locally. What you’ll neeed to do is “send” the data to a page, that page will read the variable (using the post method) and then you’ll take that string of text and output it to a local file.