Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-15-2010, 10:07 AM   #1
Registered User
Join Date: Apr 2010
Posts: 26
Question Local shared object - error

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:

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();          }
fluen is offline   Reply With Quote
Old 06-18-2010, 07:32 PM   #2
Registered User
Join Date: Apr 2010
Posts: 26

Hi all,
I solved the problem by writing this:
ActionScript Code:

Before I implemented the code, the component instantiation life cycle was trying to acces something that was not yet created.
fluen is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:27 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.