I'm creating a desktop application for the beginning of the school year and I need to be able to have people manually fill in data in text fields (input text fields), primarily just names - and when they open the application they need that data to still be there. I also want them to be able to edit and delete the data that they enter. This is what I'm using so far:
ActionScript Code:
var tfA:Array = new Array(txtName1,txtName2, txtName3, txtName4, txtName5, txtName6, txtName7, txtName8, txtName9, txtName10);
var so:SharedObject=SharedObject.getLocal("dataSO");
if(so.data){
for(var i:int=0;i<tfA.length;i++){
tfA[i].text=so.data["tf"_text"+i];
}
}
function saveTextF():void{
for(i=0;i<tfA.length;i++){
so.data["tf_text_"+i]=tfA[i].text;
}
so.flush();
}
But I keep getting this output error:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at CTIS_fla::mcBus127B_1/frame1()[CTIS_fla.mcBus127B_1::frame1:6]
. . . and after I start the application and input some test names and close the application, when I start the application back up again it's not loading the data I put in the input text fields. What am I doing wrong? Any ideas? Thanks!