Read and Write xml in a google gadget

This swf works fine when its not in a google gadget.
It will read and write xml as the user interacts wtih it. Why once its embeded inside a gadget will it only read xml? It will not send xml to my file on my server and write a new xml file.


var reg3 = new XML(myendxml);
 //Chat.text +=  "in the function";
 
 
 var variables:URLVariables = new URLVariables();
 variables.xmlData = reg3;
 variables.filename = "chat.xml";
 //variables.password= "123456";
 //
 trace(variables.toString());
 var request:URLRequest = new URLRequest("http://www.Myserver.com/writexml.php");
 request.method = URLRequestMethod.POST;
 request.data = variables;
 var loader:URLLoader = new URLLoader();
 loader.dataFormat = URLLoaderDataFormat.VARIABLES;
 try
 {
  loader.load(request);
 }
 catch (error:Error)
 {
  //Chat.text +=  "Unable to load URL";
 }