Passing Objects between Scripts

A while back I was puzzled about the correct way to pass objects between scripts; even though some of the control objects I'd like to send aren't available, such as the conference object, it'd still be nice to send objects back and forth.

I wrote to Voxeo about it, and got this reply.

You can pass an Object between scripts via the <send> element by converting your object into a string beforehand:

str = JSON.stringify(object);


and on the receiving end, simply convert this back into an object:

obj = JSON.eval(str);

As far as I can tell this sends a copy. What I was hoping to send was a reference to a single object, which would allow different scripts to update the same underlying object. That'd be handy to allow instance to keep track of each other, or let multiple instances share and modify common information. The other way to share and track between instances is via , which is quite awkward.

I'll test this and see what happens, but unless I blog otherwise, this is a copy operation.