Mike

You need to send your data to some kind of server side code (Eg. PHP).
>From your code, you are sending data to a text file. A text file has
no idea what to do with the data you are sending it (Actually, the
text file doesn't even see the data - text files are very
unintelligent as files go) so does nothing. Your code does exactly
what you told it to. It made the request to load the file. Once the
request is made the complete event fires and you get your message.

What you need is some form of server to run code on. What server do
you have?



--- In flexcoders@yahoogroups.com, "mccaffreymike" <mcc.m...@...> wrote:
>
> Flex rookie here...
> 
> Trying to read/change/write a text file on the server.
> 
> Why doesn't this file save work?
> 
> I'm able to use the URLRequest/URLLoader to read the file, but want 
> to write changes back to the file.
> 
> I get the "File saved" message but the file is not updated.
> 
> Thanks 
> 
> //save the file 
> request = new URLRequest("C:\\temp.txt");
> request.method = URLRequestMethod.POST; 
> request.data = changedData;
> 
> loader = new URLLoader();
>               loader.addEventListener(Event.COMPLETE, 
> saveComplete);   
> loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);   
> 
> try {
>       loader.load(request);  
> }
> catch (e:Error){
>       Alert.show("Error in loader.load" + e.message);
> }
> 
>   }
> 
> private function saveComplete(event:Event):void {   
> Alert.show("File saved"); 
> }
>


Reply via email to