# Read and Write xml in a google gadget

**URL:** <https://forum.kirupa.com/t/read-and-write-xml-in-a-google-gadget/314745>\
**Category:** flash\
**Created:** [October 7, 2010, 1:28pm UTC](https://forum.kirupa.com/t/read-and-write-xml-in-a-google-gadget/314745 "2010-10-07T13:28:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdsflash](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jdsflash](https://forum.kirupa.com/u/jdsflash)\
**Post date:** [October 7, 2010, 1:28pm UTC](https://forum.kirupa.com/t/read-and-write-xml-in-a-google-gadget/314745/1 "2010-10-07T13:28:39Z")

</div>

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.

```auto

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";
 }
 
 
 

```
