Here is what I am trying to accomplish I am able to retrieve variables from a txt file that is stored with the SWF file in the same directory and display them in individual dynamic text fields. What I am unable to do is allow the user to change a line “item” and then have them save it. So that the next time they come back or another person with access to the files can open it and see the updated list.
I have asked for help on another forum but it seems I am not explaining my
self well enough…
Here is what I had written:
So here is what I need to figure out:
A user goes to a page and sees 20 lines of text box’s most have content… each one pulles from a diffrent text file.
e.g.
box1.text = text1.txt - ( save button )
box2.text = text2.txt - ( save button )
e.t.c.
its all set as input text so they can see what someone else put there and they can change the text then click on the save button next to each line to update the text so that the next person can see a new item added. Think
of it as a kind of chalk board or fridge magnet app that multiple people can update. The current set of code only lets you input text to a file that you have to phsically find and over write? Do I need to scrap that idea and go with a cookie session kind of thing or scrap that all together and interact
with a mysql so that the information is available to multiple people useing the flash file. I was hoping to save the file automatically to a fixed folder on a file syncing service on all of our computers because once saved that
file is updated on all 6 computers at once.
The Code I am reffering to is:
[FONT=Courier New]import flash.net.FileReference;
import flash.events.IOErrorEvent;
import flash.events.Event;
const fileName:String = "sample.txt";
var fr:FileReference;
saveButton.addEventListener(MouseEvent.CLICK,onSaveClick);
function onSaveClick(myEvent:MouseEvent):void {
fr = new FileReference();
fr.addEventListener(Event.COMPLETE, onFileSave);
fr.addEventListener(Event.CANCEL,onCancel);
fr.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
fr.save(inputField.text, fileName);
}
function onFileSave(e:Event):void {
trace("File Saved");
fr = null;
}
function onCancel(e:Event):void {
trace("File save select canceled.");
fr = null;
}
function onSaveError(e:IOErrorEvent):void {
trace("Error Saving File : " + e.text);
fr = null;
}[/FONT]
Which only works as a file uploader… I need to do this so that once save is clicked a file or mysql or cookie is updated or replaced no file upload window pops up that defeats the purpose or ease of use of this app.
Any help would be greatly appreciated!