Greetings to all,
I am trying to save text via local shared object. But I get the error 1009 cannot access a property or method of a null object reference.
There is a blue arrow pointing to the line where this code is located.
ActionScript Code:
tA.text=sharedObj.data.tasks;
The weird thing is that the code works fine when i run it in an new mxml with out the rest of my code.
Thank you for your input.
ActionScript Code:
//constructor
private function init():void {
so();
pimView = this;
dataModel = new DataManager();
control = new PIMController(dataModel, pimView);
appCon = new AppointmentController(dataModel, pimView);
}
public function so():void{
sharedObj = SharedObject.getLocal("tasks");
if (sharedObj.size > 0)
tA.text=sharedObj.data.tasks;
}
private function saveTasks():void {
sharedObj.data.tasks = tA.text;
sharedObj.flush();
}