I am trying to share data between an as3 swf and a as2 swf that it loaded. The problem is, I can't seem to get my as2 swf to read the localshared object written by the as3 swf. It simply returns undefined when I try to get a reference to the shared object
// AS3
_SharedObj.objectEncoding = ObjectEncoding.AMF0;
_SharedObj.data.blah = 'str';
_SharedObj.flush(500);
// ... some code to handle the flush status. I verified that the values were flushed.
// AS2
var so = SharedObject.getLocal('somestr', '/');
trace(so); // undefined!
I am at a loss here. I can read the AS2 sharedobject from AS3, but I can't do it the other way. I have verified that both are referencing the same path '/' (specifically localhost, I even checked the physical file in the filesystem, - its in the #localhost directory of the #SharedObjects directory on my mac) The objectEncoding is set to use the AS2 AMF format.
The docs specifically say to set this encoding to allow as2 to access the same shared object, so I assume it means this is possible.
Anyone have any ideas?
LocalConnection
for communication between as3 and (loaded or other) as2 swfs. – Amarghosh