views:

32

answers:

1

Hi all ,That's my code .

import fl.controls.*;

var MyText:TextArea = info_txt;

var score:XML = new XML(<score/>);
score.PlayerName = "Maged";
trace(score);

Here I create a new XML date , I want to write these data to an external text file to use it by PHP but I don't have much information about it .

Note i want to append to the text field n't write .

+1  A: 

create a URLRequest with the relevant path to the PHP, make a new URLVariables to contain the xml, set it as your URLRequests 'data' and set its method to POST. Make a URLLoader, add an event listener for the COMPLETE and ERROR events, then load the URLRequest with it.

check out livedocs for examples: URLVariables, URLLoader and URLRequest

open the file, append the text then save the file in PHP. for instance with fwrite()

shortstick