Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert text from Flash into XML 1

Status
Not open for further replies.

Andyk13

Programmer
Mar 21, 2003
1
IE
Hi.I was wondering if anyone knew how i could type some information into a textarea in flash and when i press a save button it would be saved as an xml document.I know this might be difficult with the different tags that would need to be used but a basic structure could be used.Any help would be greatly appreciated.Thanks.
 
You could definitely do this via a server. You need to write a server-side script in PHP (or ASP etc) which takes the text as a URL encoded string from Flash (sent with loadVariables or loadVars).

The stuff you type into the textfield is loaded into a variable and the save button executes actionscript to take that variable and send it to your server.

The PHP can then append the necessary tags to those variables to create your XML schema as a long string and save the result as a file on the server.

If you want to do this on the local machine then it's hard, and in MX very hard. You can write a text file to the hard drive from a Flash projector but MX has limited this functionality pretty severely.
 
The goal is to start with an xml file like:
<Images>
</Images>
and add a node such as:

<Images>
<image>image1</image>
</Images>

to the existing file. I use XML.send and it returns true (the syntax is corect triggers true), but the file has not changed. When I look at the XML in the app it is correct, but does not write just using 'myXML.send("AllImages.xml")'. I have tried sendAndLoad also with no luck.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top