Hi there!
I have an input textfield on stage with an instance name of abc. That textfield is connected to a text editor component.
I will onlyshow the code regarding the xml.
1:st I load the xml into the txtfield.
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(new URLRequest("test.xml"));

function xmlLoaded(e:Event):void
{
	xml = XML(e.target.data);
	xml.ignoreWhitespace = true;
	abcVar = abc.htmlText = xml.text.*;
	//trace(abcVar);
};
This works without any problems.
Now I would like to add text & then save it to the same xml-file.
Below is the code I have for that.
Code:
savingBtn_mc.addEventListener(MouseEvent.CLICK, savingXML); //Save button
savingBtn_mc.buttonMode = true;

function savingXML(evt:MouseEvent):void
{	
	mcLoader.gotoAndPlay(2);
				
	var variables:URLVariables = newRLVariables();
	variables.xmlData = abcVar;
											
	var request:URLRequest = new URLRequest("testXML.php");
	request.method = URLRequestMethod.POST;
	request.data = variables;
				
	var loader:URLLoader = new URLLoader();
	loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, receiveLoaded);
	}
			
	function receiveLoaded(evt:Event):void 
	{
		if (evt.target.data.retval == 1)
	{
mcLoader.gotoAndStop(25);
	}
		else
	{
mcLoader.gotoAndStop(26);
		}
}
So I have a mc on stage called mcLoader that has textfields on different frames for saving, saved and error. The problem is that I don't seem get anything back from my php-file since the mcLoader clip only stays on "saving". I also realised that new content in the textfield probably won't be added to the xml-file since the variable I'm using for saving the xml is the same as the content of the present xml-file. My php-code is this:
PHP Code:
<?php
     
$xmlData 
$_POST["xmlData"];  //Folder HAS to have CHMOD permissions of 777.

$fp fopen ("text.xml""w");

if(
$fp)
    {  
    
fwrite($fp,stripslashes("$xmlData"));  //Check to see if open was ok & write data.
    
fclose($fp);
    echo 
"retval=1";
    } 
    else 
    {
    echo 
"retval=0";
    }

?>
And last my xml-file. I also realise that I need a way to save it corret for the Cdata tag...
Code:
<?xml version="1.0" encoding="utf-8"?>
<body>
<text><![CDATA[<P ALIGN="LEFT"><FONT FACE="Arial">Welcome to <B>AS3 Rich Text Editor Lite !</B>testar ifall det fungerar </FONT></P>]]></text>
</body>
I would really appreciate some help with this one!!!
All the best, Niklas