Issue with Multiple Text Fields and SharedObject Storing
- by user1662660
I'm currently working on an AIR for iOS application in Flash CS6. I'm trying to store multiple pieces of data from various text inputs; i.e "name_txt", "number_txt" etc.
I have the following code working for a local save file;
import flash.events.Event;
import flash.desktop.NativeApplication;
import flash.events.Event;
var n1:String = so.data.Number1;
var so:SharedObject = SharedObject.getLocal("TravelPal");
emerg1.text = n1;
emerg1.addEventListener(Event.CHANGE, updateEmerg1);
function updateEmerg1 (e:Event):void
{
so.data.Number1 = emerg1.text;
so.flush();
}
NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);
function onExit(e:Event):void
{
so.flush();
}
Now as soon as I create multiple text inputs and attempt to store them in my SharedObject, the whole system just falls apart. None of the text gets saved, even the previously working ones.
I'm pretty new to ShardObject usage. What am I missing here? Is this a good way to go about storing multiple text inputs?