Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 5 made on Thursday July 15, 2010 at 23:59
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,995
On July 15, 2010 at 19:24, pnnielsen said...
At this point, I'm trying to understand how it works so that I can do things right and in the best possible way.

Are you implying that I *can* create one instance of the object and share it with System.setGlobal? I did try this, but it does not seem to work...

No, I'm saying that you can create an object, use Rusty's utilities to convert said object to a string (or use Javascript toSource() function - see mozilla site) and the store into System global as string. You can then convert back to an object using:

var myObj = eval(System.getGlobal('MySavedObject'));
I do realize that I can use setGlobal to set global settings and use getGlobal in the library to retrieve settings & data, making it easy to use the library. This will probably work out fine for my needs, but *if* there is a way to just create one instance and use it, that would of course be ideal...

Save/restore object trees? Do I understand correctly: does this mean the same as saving all instance specific data and then letting you apply the data onto another instance of the same type? Correct? (I'm not familiar with JSON - yet).

I was explictily referring to Save/restore of an object tree. That is, saving a top-level object that contains fields referring to other objects and so on. It's called an Object Tree as it looks like an upside down tree when object references are drawn as a graph.

Thanks,
Peter
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse