PDA

View Full Version : flash and xml


xl_hybrid
01-20-2005, 09:57 PM
Hi,
i am trying to set up a message board type thing but am not familiar with xml.

I basically want users to be able to log in and edit some text, then save those changes.
Here is a link to the setup i'm trying to make:

www.offcentercrew.com/test/password/password.swf

Does anyone know of any tutorials on how to do this? I have found examples of displaying xml files, but none show you how to edit the contents and save.
Just looking for a point in the right direction. Thanks

luke
01-24-2005, 06:43 PM
you need a serverside script to actually save the xml file. You can use php or asp or whatever to do this. It's really just a few lines of code.

something like this (in php):


<?PHP

$xmlToWrite = $HTTP_RAW_POST_DATA;
$fp = fopen("yourFile.xml","w");
rewind($fp);
fwrite($fp,$xmlToWrite);
fclose($fp);

$xmlToSend = $xmlToWrite;
print $xmlToSend;
exit;

?>



your actionscript looks something like so:


response = new XML()
response.ignoreWhite = true;

yourXMLobject.sendAndLoad("http://yourserver.com/phpfile.php, response)



hope this helps