I am currently developing a form that saves all text fields, and creates a text file for each field. Some fields require a lot of information, so I figured (I think its called) URL Encoding wouldn’t be useful. I can save one text field, to one text file good. The issue I’m running into, is how to save multiple text fields on the same frame, to multiple text files.
Currently this is the code I have now:
sInfoSave.addEventListener(MouseEvent.CLICK, sInfoSaveF);
MovieClip(this.root).i=2;/*load counter*/
function sInfoSaveF(event:MouseEvent):void
{
if(i<9){
// declaring var textcontents String. You should set this first.
MovieClip(this.root).textcontents = this["t" + i].htmlText;
// declaring var foldername String. This is the folder container of the saved XML file
MovieClip(this.root).foldername;
// declaring var filename String. This is the filename of the XML file
MovieClip(this.root).filename = "t" + i +".txt";
// declaring var dataPass URLVariables
MovieClip(this.root).datapass = new URLVariables();
// declaring var urlLoader URLLoader
MovieClip(this.root).urlLoader = new URLLoader();
// declaring var previewRequest URLRequest
MovieClip(this.root).previewRequest = new URLRequest("http://people.ysu.edu/~pjbollinger/save.php");
// i used method "post" in this sample. you can edit this
previewRequest.method = URLRequestMethod.POST;
// setting dataPass variables to be passed to PHP
dataPass.filename = filename;
dataPass.textcontents = textcontents;
dataPass.foldername = foldername;
// passing dataPass data PHP
previewRequest.data = dataPass;
// calling the PHP or loading the PHP
urlLoader.load(previewRequest);
i++
}
else
{trace("no workey")}
}
EDIT: I renamed my text fields t2, t3… t9.
Also, I run into no compiler errors.
Any help would be greatly appreciated.