View Full Version : Local shared object - error

06-15-2010, 10:07 AM
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.

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.

private function init():void {

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)


private function saveTasks():void {
sharedObj.data.tasks = tA.text;

06-18-2010, 07:32 PM
Hi all,
I solved the problem by writing this: creationPolicy="all" :D
Before I implemented the code, the component instantiation life cycle was trying to acces something that was not yet created.